As in the hint, let u = x {\displaystyle u={\sqrt {x}}} so that d u = d x 2 x = d x 2 u {\displaystyle du={\frac {dx}{2{\sqrt {x}}}}={\frac {dx}{2u}}} . This gives
∫ cos x d x = ∫ 2 u cos ( u ) d u {\displaystyle \int \cos {\sqrt {x}}\,dx=\int 2u\cos(u)\,du}
To solve this last integral, we use integration by parts. Let
w = u v = sin ( u ) d w = d u d v = cos ( u ) d u {\displaystyle {\begin{aligned}w=u\quad &\quad v=\sin(u)\\dw=du\quad &\quad dv=\cos(u)du\end{aligned}}}
Then, we have
∫ 2 u cos ( u ) d u = 2 ∫ u cos ( u ) d u = 2 u sin ( u ) − 2 ∫ sin ( u ) d u = 2 u sin ( u ) + 2 cos ( u ) + C {\displaystyle {\begin{aligned}\int 2u\cos(u)\,du&=2\int u\cos(u)\,du\\&=2u\sin(u)-2\int \sin(u)\,du\\&=2u\sin(u)+2\cos(u)+C\end{aligned}}}
and hence
∫ cos ( x ) d x = 2 x sin ( x ) + 2 cos ( x ) + C . {\displaystyle {\begin{aligned}\int \cos({\sqrt {x}})\,dx&=2{\sqrt {x}}\sin({\sqrt {x}})+2\cos({\sqrt {x}})+C.\end{aligned}}}