# If $\tan(\theta$) = $\frac{x}{7}$ for -$\frac{\pi}{2} < \theta < \frac{\pi}{2}$, find an expression for $\sin(2\theta$) in terms of $x$.

I know that $$\sin(2\theta) = 2\sin(\theta)\cos(\theta)$$. So I have to take $$\tan(\theta) = \frac{x}{7}$$ and find values for sin and cos in terms of $$x$$. So here goes:

$$\frac{\sin(\theta)}{\cos(\theta)} = \frac{x}{7}$$

Then $$\cos(\theta) = \frac{7\sin(\theta)}{x}$$ and $$\sin(\theta) = \frac{x\cos(\theta)}{7}$$

Now to find cos and sin in terms of $$x$$ I plug in values into $$\sin^2(\theta) + \cos^2(\theta) = 1$$

$$\left(\frac{x\cos(\theta)}{7}\right)^2 + \cos^2(\theta) = 1$$ then $$\cos^2(\theta) = \frac{49}{x^2+49}$$

$$\sin^2(\theta) + \left(\frac{7\sin(\theta)}{x}\right)^2 = 1$$ then $$\sin^2(\theta) = \frac{x^2}{x^2+49}$$

Now plug these values into $$2\sin(\theta)\cos(\theta)$$ and I get $$2\left(\frac{x}{\sqrt{x^2+49}}\right)\left(\frac{7}{\sqrt{x^2+49}}\right)$$

This is very different than the answer in the book and the graphs are different too. Can someone please tell me what I'm doing wrong? The book answer is $$1-\frac{x^2}{x}$$

For example, you can not say immediately that $$\sin\theta=\frac{x}{\sqrt{49+x^2}}$$ because $$|\sin\theta|=\frac{|x|}{\sqrt{49+x^2}}.$$
We can make the following. $$\sin2\theta=\frac{2\tan\theta}{1+\tan^2\theta}=\frac{\frac{2x}{7}}{1+\frac{x^2}{49}}=\frac{14x}{49+x^2}.$$