[Tex/LaTex] Drawing rectangle triangles with labels only in its sizes

tikz-pgf

I'm doing an exercise of integral calculus. The integral is $\int \dfrac{dx}{4-x^2}$. This integral can be solved doing $x = 2\sin\,\alpha$, and its solution is $\dfrac{1}{2}\ln\,|\sec\,\alpha + \tan\,\alpha|+C$. I need to draw a rectangle triangle to avoid doing all the tedious maths, trying to find $\sec\,\alpha$ and $\tan\,\alpha$ in terms of $x$. In the image is what I'm trying to draw.

wanted

Best Answer

With tkz-euclide:

\documentclass[border=5mm]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[scale=.8]
\tkzInit[xmax=5,ymax=3] %\tkzClip[space=.5]
\tkzDefPoint(0,0){A} \tkzDefPoint(4,0){B}
\tkzDrawTriangle[pythagore](A,B)
\tkzGetPoint{C}
\tkzMarkRightAngle(A,B,C)
\tkzDrawPoints(A,B,C)
\tkzLabelPoints[below](A,B)
\tkzLabelPoints[above](C)
\tkzLabelSegment[below,font=\footnotesize](A,B){$\sqrt{4 - x^2}$}
\tkzLabelSegment[above,font=\footnotesize](A,C){$2$}
\tkzLabelSegment[right,font=\footnotesize](B,C){$x$}
\tkzMarkAngle[fill= blue!40,size=1.4cm,opacity=.5](B,A,C)
\tkzLabelAngle[pos=0.8](B,A,C){$\alpha$}
\end{tikzpicture}
\end{document}

enter image description here