# Just Observed A Cool Result!

I just found a generalised formula to find the range of the functions of the form: $f(x)=a\cos x + b\sin x + c$

The range of the above function would be: $\left[-\sqrt{a^2+b^2}+c, \sqrt{a^2+b^2}+c\right]$.

Here's what I did;

1. Multiply and divide the function by $\sqrt{a^2 + b^2}$;

$f(x)=\sqrt{a^2 + b^2}\left(\dfrac{a\cos x}{\sqrt{a^2 + b^2}} + \dfrac{b\sin x}{\sqrt{a^2 + b^2}}\right)+c$

2. Now, say that there exists a right triangle whose sides are $a, b, \sqrt{a^2 + b^2}$, such that;

$\sin\beta = \dfrac{a}{\sqrt{a^2 + b^2}};\quad \cos\beta = \dfrac{b}{\sqrt{a^2 + b^2}}$

3. Substitute the above values in the function to get:

\begin{aligned} f(x)&=\sqrt{a^2 + b^2}\left(\sin\beta\cos x+ \cos\beta\sin x\right) + c\\ &=\sqrt{a^2 + b^2}\sin(\beta +x)+c\\ \end{aligned}

4. Now let us say that the angle $\beta + x=\alpha$, thus the maximum value of $\sin\alpha = 1$ and the minimum value of $\sin\alpha = -1$, hence;

\begin{aligned} f(x)_{\text{max}}&=\sqrt{a^2 + b^2}+c\\ f(x)_{\text{min}}&=-\sqrt{a^2 + b^2}+c\\ \end{aligned} Note by Sravanth Chebrolu
3 years, 8 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

That is a general method in practice. Anyway finding it on your own is great! !

- 3 years, 8 months ago

Oh I thought so, thanks!

- 3 years, 8 months ago

I try...we have $f(x)=a\cos x + b\sin x + c$ If we derive we obtain $f'(x)=-a\sin x + b\cos x$ To find max/min $-a\sin x + b\cos x=0$ We find $\cos x=\frac{a}{b}\sin x$ $\tan x=\frac{b}{a}$ So now we can replace them in f(x) $y_{max}=(\frac{a^2+b^2}{b})\sin(\tan^{-1}(\frac{b}{a})) + c$

but if we consider a rectangle triangle with sides a, b and c, where alpha is the angle between b and c (and the angle between a and b is 90°) then

$\sin(\tan^{-1}(\frac{b}{a}))=\frac{b}{c}=\frac{b}{\sqrt{a^2+b^2}}$

So now

$y_{max}=\sqrt{a^2+b^2} + c$

We can try to see that it is really the maximum of f(x), so the minimum symmetrically must be

$y_{min}=-\sqrt{a^2+b^2} + c$

Right...?

- 3 years, 8 months ago

Exactly! I almost did the same! Splendid!

I have reduced some steps, thanks for posting it!

- 3 years, 8 months ago

For an elegant proof try using Cauchy Schwarz Inequality.

- 3 years, 8 months ago

@Matteo Monzali: Since you have posted this, I have given another version of what I did. Please check that out.

- 3 years, 8 months ago

Yes, but I think your method is easier than mine! :)

- 3 years, 8 months ago