The given function is y = a cos x + b sin x
Differentiating both sides with respect to x, we have
dy/dx = -a sin x + b cos x
Putting values of dy/dx and y in the given differential equation, we have
L.H.S. = cos x (- a sin x + b cos x) + {a cos x + b sin x) sin x
= – a sin x cos x + b cos2 x + a sin x cos x + b sin2 x
= b (cos2 x + sin2 x)
= b × 1 = b = R.H.S
Thus, y = a cos x + b sin x is a solution of differential equation
cos x(dy/dx) + y sin x = b.