How to caluclate the integral of $\int \frac{1}{\sqrt{4x^{2}+1}}dx$ using a trig substitution? I am trying to determine the following integral: $\int \frac{1}{\sqrt{4x^{2}+1}} dx$ using a suitable substitution.
My progress:
let $x = \frac{1}{2} \tan \theta$
$dx = \frac{1}{2}\sec^{2} \theta d\theta$
$$\int \frac{1}{1+\tan^{2}\theta}\times \frac{1}{2}\times \sec^{2} \theta d\theta$$
$$= \frac{1}{2} \times \int 1 d\theta$$
$$ = \frac{1}{2} \theta + c$$
I know I have to get my answer back in terms of $x$, but I am a little stuck. Can someone please help?
 A: You forgot the square root 
$$x=\frac{1}{2} \tan \theta \implies dx= \frac{1}{2} \sec^2 \theta d\theta $$
The integral becomes: 
$$\int \frac{1}{\sqrt{1+tan^2 \theta}} \cdot \frac{1}{2} \sec^2 \theta d\theta$$

$$\Large{\text{Not:}}$$
$$\bbox[8pt, border: crimson 4pt solid]{\int \frac{1}{1+tan^2 \theta} \cdot \frac{1}{2} \sec^2 \theta d\theta}$$
A: What happened to the square root? $\sqrt{\tan^2\theta+1}=\sqrt{\sec^2\theta}=|\sec\theta|$. So you have $$\frac12\int\frac{1}{|\sec\theta|}\sec^2\theta\,d\theta=\frac12\int|\sec\theta|\,d\theta$$ In the original substitution $2x=\tan\theta$, $\theta$ is in a range where $\sec\theta$ is positive, so actually we just have $$\frac12\int\sec\theta\,d\theta=\frac12\ln|\sec\theta+\tan\theta|+C=\frac12\ln\left|\sqrt{4x^2+1}+2x\right|+C$$
A: If $x = \frac{1}{2} \tan \theta$, then $\theta = \tan^{-1} 2x$.
But you have a more important problem:  the integrand you wrote is $$\frac{1}{\sqrt{1+4x^2}},$$ whereas what you integrated was $$\frac{1}{1+4x^2},$$ because you forgot the square root.  You should have instead written $$\int \frac{dx}{\sqrt{1+4x^2}} = \frac{1}{2} \int \sec \theta \, d\theta.$$  The integration of this function uses a trick:  write the integrand as $$\frac{\sec^2 \theta + \sec \theta \tan \theta}{\sec \theta + \tan \theta}.$$
A: If you mean $x=\frac12 \tan \theta$, then isn't it that $\theta=\arctan 2x$?
By the way, I think the correct approach should be:
(1).Let $x=\frac12 \tan \theta$, thus $dx=\frac12 \sec^2\theta d\theta$.
(2).Rewrite the integral as
$$I=\int \frac{1}{\sqrt{4x^{2}+1}} dx=\frac{1}{2}\int |\sec \theta | d\theta$$
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
With the sub $\ds{x \equiv \frac{1 - t^{2}}{4t}\ \imp\ t = \root{4x^{2} + 1} - 2x}$
we'll find:
\begin{align}&\color{#66f}{\large\int\frac{\dd x}{\root{4x^{2} + 1}}}
=-\,\half\int\frac{\dd t}{t}=-\,\half\ln\pars{t}
\\[5mm]&=\color{#66f}{\large-\,\half\ln\pars{\root{4x^{2} + 1} - 2x}} + \mbox{a constant}
\end{align}
