# To maximise a trigonometric function

## Homework Statement

What is the maximal value of
f(x) = sin(x) - $$\sqrt{3} cos(x)$$
such that
0 <= x < 360?

## The Attempt at a Solution

To raise to power to two

$$f^2 = sin^2(x) - 2 \sqrt{3} sinx cosx + 3cos^2(x)$$

I obverse that the last term has the greatest coeffient so
I maximise it by
setting x = 0.

We get
f^2(0) = 3
and

f = 3^.5

However, the right answer is 2.

How can you get the right answer?

## Answers and Replies

Cyosis
Homework Helper
Why did you take the square? To maximize the function you need to take the derivative of f with respect to x and equal it to zero. You will find two types of x-es, one that minimizes and one that maximizes. Start with calculating f'(x).

HallsofIvy
Science Advisor
Homework Helper
Another way to do that, without differentiating, is to use the trig identity sin(r+ t)= sin(r)cos(t)+ cos(r)sin(t). Of course, you can't find t such that sin(t)= 1 and $cos(t)= \sqrt{3}$ because you must have $cos^2(t)+ sin^2(t)= 1$ while
[tex]1^2+ (\sqrt{3})^2}= 1+ 3= 4[/itex]
Okay, write that as
[tex]2(\frac{1}{2}sin(x)+(-\frac{\sqrt{3}}{2}cos(x))[/itex]

Then $sin(x)+ \sqrt{3}cos(x)= 2 sin(x+ \theta)$ where $\theta$ is the angle such that $cos(\theta)= 1/2$ and $cos(\theta)= \sqrt{3}/2$. That's easy to find, but it really doesn't matter what $\theta$ is.

Another way to do that, without differentiating, is to use the trig identity sin(r+ t)= sin(r)cos(t)+ cos(r)sin(t). Of course, you can't find t such that sin(t)= 1 and $cos(t)= \sqrt{3}$ because you must have $cos^2(t)+ sin^2(t)= 1$ while
[tex]1^2+ (\sqrt{3})^2}= 1+ 3= 4[/itex]
Okay, write that as
[tex]2(\frac{1}{2}sin(x)+(-\frac{\sqrt{3}}{2}cos(x))[/itex]

Then $sin(x)+ \sqrt{3}cos(x)= 2 sin(x+ \theta)$ where $\theta$ is the angle such that $cos(\theta)= 1/2$ and $cos(\theta)= \sqrt{3}/2$. That's easy to find, but it really doesn't matter what $\theta$ is.

Thank you for your answer!

I really remember that to raise to the power 2 is often useful in trig calculations.
It seems that this time the strategy:
1. raise to the power 2
2. and consider the extreme situation
did not work.

I believe that you can get the same result also with my strategy.
However, I am unsure how to get 2 out of my formula.
The best which I can do is
3^.5