Class 12 Maths, Worked in Full Past papersGet updates
Chapter 6 · Application of Derivatives

Exercise 6.3 · Q9: Maximum of sin⁡x+cos⁡x\sin x+\cos x

Exercise 6.3Maximum value of a function · Sections 6.4 and 6.4.1
The question

9. What is the maximum value of the function sin⁡x+cos⁡x\sin x+\cos x⁠?

Exam answer

Since cos⁡π4=sin⁡π4=12\cos\frac{\pi}{4} = \sin\frac{\pi}{4} = \frac{1}{\sqrt2}⁠,

sin⁡x+cos⁡x=2(sin⁡xcos⁡π4+cos⁡xsin⁡π4)=2sin⁡(x+π4)\begin{aligned} &\sin x + \cos x \\ &= \sqrt2\left(\sin x\cos\tfrac{\pi}{4} + \cos x\sin\tfrac{\pi}{4}\right) \\ &= \sqrt2\sin\left(x + \tfrac{\pi}{4}\right) \end{aligned}

As sin⁡(x+π4)≤1\sin\left(x + \frac{\pi}{4}\right) \le 1⁠, sin⁡x+cos⁡x≤2\sin x + \cos x \le \sqrt2⁠, with equality at x=π4x = \frac{\pi}{4}⁠.

The maximum value of sin⁡x+cos⁡x\sin x + \cos x is 2\sqrt2⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Adding a sine wave and a cosine wave of the same period gives another sine wave, only taller and shifted: sin⁡x+cos⁡x=2sin⁡(x+π4)\sin x+\cos x=\sqrt2\sin\left(x+\frac{\pi}{4}\right)⁠. A sine never exceeds 11⁠, so this never exceeds 2\sqrt2⁠, and it equals 2\sqrt2 when x=π4x=\frac{\pi}{4}⁠. Calculus on one full period gives the same answer.

Given, to find, and the plan
Given
f(x)=sin⁡x+cos⁡xf(x)=\sin x+\cos x for all real xx (no interval is stated).
To find
The maximum value of ff on R\R⁠.
Plan
Method 1: rewrite ff as a single sine, bound it, and find where the bound is reached. Method 2: use periodicity to reduce to the closed interval [0,2π][0,2\pi] and apply the Working Rule of Section 6.4.1.

Basics you need

1Sine of a sum

sin⁡(A+B)=sin⁡Acos⁡B+cos⁡Asin⁡B\sin(A+B)=\sin A\cos B+\cos A\sin B⁠, and sin⁡π4=cos⁡π4=12\sin\frac{\pi}{4}=\cos\frac{\pi}{4}=\frac{1}{\sqrt2}⁠. Basics: sin and cos on the unit circle

2Range of sine

sin⁡t≤1\sin t\le1⁠, with equality exactly when t=π2+2nπt=\frac{\pi}{2}+2n\pi⁠.

3Periodicity

sin⁡(x+2π)=sin⁡x\sin(x+2\pi)=\sin x and cos⁡(x+2π)=cos⁡x\cos(x+2\pi)=\cos x⁠, so ff repeats every 2π2\pi⁠: every value of ff on R\R already occurs for some xx in [0,2π][0,2\pi]⁠.

4Working Rule (Section 6.4.1)

On a closed interval, compare ff at the interior critical points and at the end points. Lesson: absolute extrema on a closed interval

Solution

  1. Method 1: write ff as one sine

    Expand 2sin⁡(x+π4)\sqrt2\sin\left(x+\frac{\pi}{4}\right) with the sum formula:

    2(sin⁡xcos⁡π4+cos⁡xsin⁡π4)=2⋅12(sin⁡x+cos⁡x)=sin⁡x+cos⁡x.\begin{aligned} &\sqrt2\left(\sin x\cos\tfrac{\pi}{4}+\cos x\sin\tfrac{\pi}{4}\right)\\ &=\sqrt2\cdot\tfrac{1}{\sqrt2}\left(\sin x+\cos x\right)\\ &=\sin x+\cos x. \end{aligned}

    So f(x)=2sin⁡(x+π4)f(x)=\sqrt2\sin\left(x+\frac{\pi}{4}\right) for every real xx⁠.

    The factor 2\sqrt2 is chosen so that 2⋅12=1\sqrt2\cdot\frac{1}{\sqrt2}=1⁠: it makes the coefficients of sin⁡x\sin x and cos⁡x\cos x both 11⁠. In general asin⁡x+bcos⁡xa\sin x+b\cos x has the "height" a2+b2\sqrt{a^2+b^2}⁠, here 1+1=2\sqrt{1+1}=\sqrt2⁠.
    Sine of a sum. Basics
  2. Bound it and find where the bound is reached

    Since sin⁡(x+π4)≤1\sin\left(x+\frac{\pi}{4}\right)\le1⁠, we get f(x)≤2f(x)\le\sqrt2 for all xx⁠. Equality needs x+π4=π2+2nπx+\frac{\pi}{4}=\frac{\pi}{2}+2n\pi⁠, i.e. x=π4+2nπx=\frac{\pi}{4}+2n\pi⁠. For example

    f ⁣(π4)=22+22=2.f\!\left(\tfrac{\pi}{4}\right)=\tfrac{\sqrt2}{2}+\tfrac{\sqrt2}{2}=\sqrt2.

    So the maximum value is 2\sqrt2.

    Both parts of Definition 3 are now in place: 2\sqrt2 is never exceeded, and it is actually attained.
    Definition 3, Section 6.4 (printed with >\gt⁠; read ≥\ge⁠). Lesson: maxima and minima
  3. Method 2: calculus on one period

    Because ff has period 2π2\pi⁠, its maximum value on R\R is its maximum value on [0,2π][0,2\pi]⁠. There, f′(x)=cos⁡x−sin⁡xf'(x)=\cos x-\sin x⁠. If cos⁡x=0\cos x=0 then sin⁡x=±1\sin x=\pm1 and f′≠0f'\ne0⁠, so at a zero of f′f' we may divide by cos⁡x\cos x⁠: tan⁡x=1\tan x=1⁠, giving x=π4x=\frac{\pi}{4} or 5π4\frac{5\pi}{4} in [0,2π][0,2\pi]⁠.

    xx00π4\frac{\pi}{4}5π4\frac{5\pi}{4}2π2\pi
    sin⁡x+cos⁡x\sin x+\cos x112\sqrt2−2-\sqrt211

    The largest value is 2\sqrt2⁠, at x=π4x=\frac{\pi}{4}⁠, matching Method 1.

    The Working Rule needs a closed interval; R\R is not one, which is why we first use periodicity. At 5π4\frac{5\pi}{4} both sine and cosine equal −22-\frac{\sqrt2}{2}⁠, giving −2-\sqrt2 (the minimum value).
    Working Rule, Section 6.4.1. Lesson: absolute extrema
x y O −3π/4 π/4 5π/4 2π −√2 √2 y = √2 y = −√2
sin⁡x+cos⁡x=2sin⁡(x+π4)\sin x+\cos x=\sqrt2\sin\left(x+\frac{\pi}{4}\right)⁠: a wave of height 2\sqrt2⁠, touching the dashed line y=2y=\sqrt2 at x=π4x=\frac{\pi}{4} (and every 2π2\pi after), and y=−2y=-\sqrt2 at x=5π4x=\frac{5\pi}{4} and −3π4-\frac{3\pi}{4}⁠.
Result

The maximum value of sin⁡x+cos⁡x\sin x+\cos x is 2\sqrt2, attained at x=π4+2nπx=\frac{\pi}{4}+2n\pi (nn any integer).

(Textbook answer: Maximum value = √2.)

Check it with numbers

f(0.785398)≈0.707107+0.707107f(0.785398)\approx0.707107+0.707107 =1.414214=2=1.414214=\sqrt2⁠. ✓

f(0.7)≈1.409060f(0.7)\approx1.409060 and f(0.9)≈0.783327+0.621610f(0.9)\approx0.783327+0.621610 =1.404937=1.404937⁠, both below 1.4142141.414214⁠. ✓

Common mistakes
  1. Answering 22 because each of sin⁡x\sin x and cos⁡x\cos x can be 11⁠. They are never 11 at the same xx⁠.
  2. Applying the closed-interval rule directly to R\R⁠. First reduce to one period, or use the single-sine form.
  3. Dividing by cos⁡x\cos x without checking it is non-zero.
What to take away
  1. asin⁡x+bcos⁡xa\sin x+b\cos x has maximum value a2+b2\sqrt{a^2+b^2} and minimum value −a2+b2-\sqrt{a^2+b^2}⁠.
  2. For a periodic function, the maximum over all real numbers is the maximum over one period.

Every fact used, and where it comes from

FactUsed inSource
sin⁡(A+B)=sin⁡Acos⁡B+cos⁡Asin⁡B\sin(A+B)=\sin A\cos B+\cos A\sin B⁠; sin⁡π4=cos⁡π4=12\sin\frac{\pi}{4}=\cos\frac{\pi}{4}=\frac{1}{\sqrt2}Step 1Class XI, Chapter 3 (Trigonometric Functions) (Basics)
sin⁡t≤1\sin t\le1⁠, equality at t=π2+2nπt=\frac{\pi}{2}+2n\pi⁠; period 2π2\piSteps 2, 3Class XI, Chapter 3
Maximum value of a functionStep 2Definition 3, Section 6.4 (Lesson: maxima and minima)
Theorems 5, 6 and the Working RuleStep 3Section 6.4.1 (Lesson: absolute extrema)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →