<s>[INST] If $y = a\sin{x} + b\cos{x} +C$ then find maxima and minima for $y$. I was able to solve it till
$$y = \sqrt{(a^2 + b^2)}\sin(\alpha + x)  +  C.$$
But I don't know how to find maxima and minima from here.
If $C = 0$ then maxima & minima equals the amplitude of the sine curve but when $C$ is non-zero then?
I need help from here onwards.
 [/INST] The old way:
$$y'=a\cos x-b\sin x=0\iff\tan x=\frac ab\iff x=\arctan\frac ab+k\pi.$$
Then
$$\sin\theta=\pm\frac{a}{\sqrt{a^2+b^2}},\\\cos\theta=\pm\frac{b}{\sqrt{a^2+b^2}},$$ and
$$y=\pm\frac{a^2+b^2}{\sqrt{a^2+b^2}}+c=\pm\sqrt{a^2+b^2}+c.$$
The maximum obviously corresponds to the plus sign.
</s>