Un calcul de primitive

(cet exercice est issu de l’oral Mines-Ponts Psi 2015)
Calculer une primitive de {x\mapsto \sqrt{2+\tan^{2}(x)}}.

On procède au changement de variable {\tan(x)=\sqrt2\,\text{sh}(t)}.

Ainsi {\sqrt{2+\tan^{2}(x)}=\sqrt2\,\text{ch}(t)}, et {\,\text{th}(t)=\dfrac{\tan(x)}{\sqrt{2+\tan^{2}(x)}}}.

On a {\sqrt2\,\text{ch}(t)\,\text{d}t=(1+\tan^{2}(x))\,\text{d}x=(1+2\,\text{sh}^{2}(t))\,\text{d}t}.

On obtient alors les égalités :{{\displaystyle\int}\sqrt{2+\tan^{2}(x)}\,\text{d}x=\displaystyle\int\dfrac{2\,\text{ch}^{2}(t)}{1+2\,\text{sh}^{2}(t)}\,\text{d}t=\displaystyle\int\dfrac{1+\,\text{ch}(2t)}{\,\text{ch}(2t)}\,\text{d}t=t+\displaystyle\int\dfrac{\,\text{d}t}{\,\text{ch}(2t)}}On pose ensuite {u=\,\text{th}(t)} donc {\,\text{d}u=(1-u^{2})\,\text{d}t}.

On a {\,\text{ch}(2t)=\dfrac{1+u^{2}}{1-u^{2}}}, donc {\displaystyle\int\dfrac{\,\text{d}t}{\,\text{ch}(2t)}=\displaystyle\int\dfrac{\,\text{d}u}{1+u^{2}}=\arctan(u)+K}.

On a {u=\dfrac{\tan(x)}{\sqrt{2+\tan^{2}(x)}}} et {\text{e}^{t}=\,\text{sh}(t)+\,\text{ch}(t)=\dfrac{1}{\sqrt2}\bigl(\tan(x)+\sqrt{2+\tan^{2}(x)}\bigr)}.

Finalement (le résultat étant valable à une constante additive près) :
{{\displaystyle\int}\sqrt{2+\tan^{2}(x)}\,\text{d}x=\ln\bigl(\tan(x)+\sqrt{2+\tan^{2}(x)}\bigr)+\arctan\biggl(\dfrac{\tan(x)}{\sqrt{2+\tan^{2}(x)}}\biggr)}