# Differentiate the function: $y = \tan\theta(\sin\theta + \cos\theta)$

Differentiate the function: $$y = \tan\theta(\sin\theta + \cos\theta)$$

How I approached the question:

$$y = \tan\theta(\sin\theta + \cos\theta)$$ $$y = [\tan\theta\sin\theta] + [\tan\theta\cos\theta]$$

Using the Product Rule: $f'g + fg'$

$$y' = [\sec^2\theta\sin\theta + \tan\theta\cos\theta] + [\sec^2\theta\cos\theta + (\tan\theta)(-\sin\theta)]$$

$$y' = \sec^2\theta\sin\theta + \tan\theta\cos\theta + \sec^2\theta\cos\theta -\sin\theta\tan\theta$$

At this point, I have no idea how to simplify it any further.

• hint: sec x = 1 / cos x; tan x = sin x / cos x – John Dvorak Dec 14 '13 at 22:36

Use directly the product rule: \begin{align} (\tan\theta(\sin\theta+\cos\theta))'&= \tan'\theta(\sin\theta+\cos\theta)+\tan\theta(\sin\theta+\cos\theta)'\\ &= \frac{1}{\cos^2\theta}(\sin\theta+\cos\theta)+\tan\theta(\cos\theta-\sin\theta)\\ &=\frac{\sin\theta}{\cos^2\theta}+\frac{1}{\cos\theta}+\sin\theta-\frac{\sin^2\theta}{\cos\theta}\\ &=\frac{\sin\theta}{\cos^2\theta}+\sin\theta+\cos\theta \end{align}

On the right side, the derivative of $\tan \theta \cos \theta$ is

$$(\tan \theta \cos \theta)' = \sec^2 \theta \cos \theta - \tan \theta \sin \theta$$.

Notice the difference in the first term with your answer.

Now to simplify it, use the fact that $\sec\theta = \frac{1}{\cos\theta}$ and that $\tan\theta = \frac{\sin\theta}{\cos\theta}$ to simplify further.

You don't even need to distribute. In fact, it's easier not to:

$y=tan\theta (sin\theta +cos\theta)$

$\frac{dy}{d\theta}=tan\theta (cos\theta-sin\theta)+(sin\theta+cos\theta)(sec^2\theta)$

I'll try to simplify:

$=sin\theta-\frac{sin^2\theta}{cos\theta}+\frac{sin\theta}{cos^2\theta}+\frac{1}{cos\theta}$

$=sin\theta+\frac{1-sin^2\theta}{cos\theta}+\frac{sin\theta}{cos^2\theta}$

$=sin\theta + cos\theta + \frac{sin\theta}{cos^2\theta}$