How do I find the maximum or minimum value of $a \sin(x) + b \cos(x)$, if any?

953 Views Asked by At

Given the function $$f(x) = a \sin(x) + b \cos(x)$$

I have to find the value of $x$ for which $f(x)$ attains its maxima or minima.

4

There are 4 best solutions below

1
On

Let $\frac{b}{\sqrt{a^2+b^2}}$=$\sin k$

So above thing becomes $\sqrt{a^2+b^2} (\sin x\cos k + \sin k\cos x)=\sqrt{a^2+b^2}\sin {(x+k)}$

0
On

By vector calculus:

This is the dot product of two vectors, of respective lengths $1$ and $\sqrt{a^2+b^2}$. Hence

$$\pm\sqrt{a^2+b^2}$$ when the vectors are in phase or in opposition.

1
On

Let $a \sin(x)+b \cos(y)=C \sin(x+y)$ for all $x$.
Since the equation is an identity, $C \cos(y)=a$ and $C \sin(y)=b$.
$\tan(y)=b/a$, $y=\arctan(b/a)$
$f'(x)=C\cos(x+\arctan(b/a))$
$f'(x)=0$ when $x+\arctan(b/a)=\pi/2$ or $3\pi/2$
$\cot(x)=\tan(\arctan(b/a))=b/a$
$\tan x=a/b$, max or min of $f(x)$ occurs for $x=\arctan(a/b)$ or $x=\arctan(a/b) + \pi$

1
On

Set the derivative to zero; then solve for $x$.

$$f^{\prime}=a\,\cos(x)+b\,(-\sin(x))=0$$ $$\frac{a}{b}=\frac{\sin(x)}{\cos(x)}=\tan(x)$$ $$\tan^{-1}(\frac{a}{b})=x$$ Note, $x$ is the value that is put into your function to give the extremum. You asked for x, not the max or min. Also, there are multiples (if you care) as $x=\tan^{-1}\left(\frac{a}{b}\right)+k\pi, k=\pm0,1,2\ldots$