# How do you express f(theta)=cos(theta/2)-tan(theta/4)+sec(theta/2) in terms of trigonometric functions of a whole theta?

$f \left(\theta\right) = \frac{\left(3 + \cos \theta\right) \cdot \sqrt{2 + 2 \cos \theta}}{2 + 2 \cos \theta} + \frac{\sin \theta - \sqrt{2 - 2 \cos \theta}}{1 - \cos \theta}$

#### Explanation:

Let us begin with $\cos \left(\frac{\theta}{2}\right)$

$\cos \left(\frac{\theta}{2}\right) = \sqrt{\frac{1 + \cos \theta}{2}}$ Half-angle formula

Next, the $S e c \left(\frac{\theta}{2}\right)$ is the reciprocal of $\cos \left(\frac{\theta}{2}\right)$

That $\sec \left(\frac{\theta}{2}\right) = \sqrt{\frac{2}{1 + \cos \theta}}$

Next, the $\tan \left(\frac{\theta}{4}\right)$ can be expressed using sine and cosine:

$\tan \left(\frac{\theta}{4}\right) = \frac{\sqrt{\frac{1 - \cos \left(\frac{\theta}{2}\right)}{2}}}{\sqrt{\frac{1 + \cos \left(\frac{\theta}{2}\right)}{2}}} = \frac{1 - \cos \left(\frac{\theta}{2}\right)}{\sin} \left(\frac{\theta}{2}\right)$
$\tan \left(\frac{\theta}{4}\right) = \csc \left(\frac{\theta}{2}\right) - \cot \left(\frac{\theta}{2}\right)$

Also $\cot \left(\frac{\theta}{2}\right) = \sin \frac{\theta}{1 - \cos \theta}$ Half-angle formula for cotangent.

We can use $\theta$ now

$\tan \left(\frac{\theta}{4}\right) = \sqrt{\frac{2}{1 - \cos \theta}} - \sin \frac{\theta}{1 - \cos \theta}$
Combine the three expressions
$f \left(\theta\right) = \sqrt{\frac{1 + \cos \theta}{2}} - \left(\sqrt{\frac{2}{1 - \cos \theta}} - \sin \frac{\theta}{1 - \cos \theta}\right) + \sqrt{\frac{2}{1 + \cos \theta}}$

$f \left(\theta\right) = \frac{\left(3 + \cos \theta\right) \cdot \sqrt{2 + 2 \cos \theta}}{2 + 2 \cos \theta} + \frac{\sin \theta - \sqrt{2 - 2 \cos \theta}}{1 - \cos \theta}$