I need to derive the below RHS from the below LHS.
$$\int\frac{\sqrt{x^{2}+l^{2}}}{x}dx=\sqrt{x^{2}+l^{2}}-l\cdot\ln\left(\frac{l+\sqrt{x^2+l^2}}{x}\right)\tag{1}$$
$$x,l\in\mathbb R_{>0}\tag{2}$$
My tries are as below.
$$x=l\cdot\tan^{}\left(\theta_{}\right)\tag{3}$$
$$\frac{dx}{d\theta}=l\cdot\sec^{2}\left(\theta_{}\right)\tag{4}$$
$$dx=l\cdot\sec^{2}\left(\theta_{}\right)\cdot d\theta\tag{5}$$
$$\sqrt{x^{2}+l^2}=\sqrt{\left(l\cdot\tan^{}\left(\theta_{}\right)\right)^{2}+l^{2}}\tag{6}$$
$$=\sqrt{l^{2}\cdot\tan^{2}\left(\theta_{}\right)+l^{2}}\tag{7}$$
$$=\sqrt{l^{2}\left(1+\tan^{2}\left(\theta_{}\right)\right)}\tag{8}$$
$$=l\sqrt{1+\tan^{2}\left(\theta_{}\right)}\tag{9}$$
$$=l\sqrt{\sec^{2}\left(\theta_{}\right)}\tag{10}$$
$$=l\sec^{}\left(\theta_{}\right)\tag{11}$$ $$\therefore~~\int\frac{\sqrt{x^2+l^2}}{x}dx=\int\frac{l\sec^{}\left(\theta_{}\right)}{l\cdot\tan^{}\left(\theta_{}\right)}\left(l\cdot\sec^{2}\left(\theta_{}\right)\cdot d\theta\right)\tag{12}$$
$$=\int\frac{l\cdot\sec^{3}\left(\theta_{}\right)}{\tan^{}\left(\theta_{}\right)}d\theta\tag{13}$$
$$=l\int\frac{\sec^{3}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)\cdot\sec^{}\left(\theta_{}\right)}d\theta\tag{14}$$
$$=l\int\frac{\sec^{2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}d\theta\tag{15}$$
$$A:=\int\frac{\sec^{2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}d\theta\tag{16}$$
$$t=\sec^{}\left(\theta_{}\right)\tag{17}$$
$$\frac{dt}{d\theta}=\left(\cos^{-1}\left(\theta_{}\right)\right)'~~\leftarrow~~\text{Not a}~\arccos\left(\theta_{}\right). \tag{18}$$
$$=\left(-1\right)\left(\cos^{-2}\left(\theta_{}\right)\right)\left(-\sin^{}\left(\theta_{}\right)\right)\tag{19}$$
$$=\frac{\sin^{}\left(\theta_{}\right)}{\cos^{2}\left(\theta_{}\right)}\tag{20}$$
$$\frac{d\theta}{dt}=\frac{\cos^{2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}\tag{21}$$
$$d\theta=\left(\frac{\cos^{2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}\right)dt\tag{22}$$
$$\cos^{}\left(\theta_{}\right)=\sec^{-1}\left(\theta_{}\right)\tag{23}$$
$$\therefore~~\cos^{2}\left(\theta_{}\right)=\sec^{-2}\left(\theta_{}\right)\tag{24}$$
$$d\theta=\left(\frac{\sec^{-2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}\right)dt\tag{25}$$
$$A=\int\frac{\sec^{2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}d\theta=\int\frac{\sec^{2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}\left(\left(\frac{\sec^{-2}\left(\theta_{}\right)}{\sin^{}\left(\theta_{}\right)}\right)dt\right)\tag{26}$$
$$=\int\frac{1}{\sin^{2}\left(\theta_{}\right)}dt~~\leftarrow~~\text{Not good}\tag{27}$$
How should I've done of the integration by substitution?