question related with half angle from a given equation If $\sec x + \tan x = 3$ , then what is the value of $\tan \frac x2?$ 
i squared both sides and then converted the $\tan x $ into $\sec x$ and then $\sec  x $ into $\cos x$ which gave me value $\sqrt\frac15$. Kinda confused after this step.. help is appreciated
 A: As $\sec^2x-\tan^2x=1,$
$\sec x+\tan x=a\iff\sec x-\tan x=\dfrac1a$ for finite non-zero $a$
$\implies2\sec x=\dfrac{a^2+1}a,2\tan x=\dfrac{a^2-1}a$
$\implies\sin x=\dfrac{\tan x}{\sec x}=\cdots$
Now $\tan\dfrac x2=\dfrac{1-\cos x}{\sin x}=?$
A: HINT:
$$\sec(x)+\tan(x)=3\Longleftrightarrow$$
$$-3+\sec(x)+\tan(x)=0\Longleftrightarrow$$

Substitute $y=\tan\left(\frac{x}{2}\right)$. Than $\sin(x)=\frac{2y}{y^2+1}$ and $\cos(x)=\frac{1-y^2}{y^2+1}$:

$$\frac{2}{y-1}-\frac{4y}{y-1}=0\Longleftrightarrow$$
$$-\frac{2(2y-1)}{y-1}=0\Longleftrightarrow$$
$$\frac{2y-1}{y-1}=0\Longleftrightarrow$$
$$2y=1\Longleftrightarrow$$
$$y=\frac{1}{2}\Longleftrightarrow$$
$$\tan\left(\frac{x}{2}\right)=\frac{1}{2}\Longleftrightarrow$$
$$\frac{x}{2}=\tan^{-1}\left(\frac{1}{2}\right)+\pi n\Longleftrightarrow$$
$$x=2\tan^{-1}\left(\frac{1}{2}\right)+2\pi n$$
With $n\in\mathbb{Z}$

So it if you take $n=0$:
$$x=2\tan^{-1}\left(\frac{1}{2}\right)+2\pi n \Longrightarrow$$
$$x=2\tan^{-1}\left(\frac{1}{2}\right)+2\pi \cdot 0 =2\tan^{-1}\left(\frac{1}{2}\right) $$
Than $\tan\left(\frac{x}{2}\right)$ is:
$$\tan\left(\frac{x}{2}\right) \Longrightarrow$$
$$\tan\left(\frac{2\tan^{-1}\left(\frac{1}{2}\right)}{2}\right)=\tan\left(\tan^{-1}\left(\frac{1}{2}\right)\right)=\frac{1}{2}$$
A: Let $2y=\dfrac\pi2-x$
$3=\sec x+\tan x=\csc2y+\cot2y=\dfrac{1+\cos2y}{\sin2y}=\cot y$
$\tan\dfrac x2=\tan\left(\dfrac\pi4-y\right)=\dfrac{1-\tan y}{1+\tan y}=\dfrac{\cot y-1}{\cot +1}=?$
