5
$\begingroup$

Attempting to calculate $\displaystyle \int{\dfrac{1}{\sqrt{x^2+y^2}}\mathrm dx}$, $$\int{\dfrac{1}{\sqrt{x^2+y^2}}\mathrm dx}=\int{\frac{1}{\sqrt{(y\tan\theta)^2+y^2}}y\sec^2\theta \mathrm d\theta}=\int{\sec\theta d\theta}=\ln(\sec\theta +\tan\theta)=\ln\left(\sqrt{\left(\frac{x}{y}\right)^2+1}+\frac{x}{y}\right)=\ln\left(\frac{1}{x}\left(\sqrt{x^2+y^2}+x\right)\right),$$ where $x=y\tan\theta$

However Wolfram Integrator somehow returns $$\ln\left(2\left(\sqrt{x^2+y^2}+x\right)\right)$$ as the answer. Where did I go wrong? Many thanks.

$\endgroup$
8
  • $\begingroup$ For one, you should have factored out a $1/y$ rather than a $1/x$. The factor of two can be wrapped up in an integration constant. $\endgroup$
    – Ron Gordon
    Commented Oct 5, 2013 at 12:21
  • 1
    $\begingroup$ The only nitpick I have so far is that the coefficient in front of the natural logarithm at the end of your solution should be $\frac{1}{y}$ and not $1/x$. $\endgroup$
    – Clayton
    Commented Oct 5, 2013 at 12:21
  • $\begingroup$ I think the wolfram integrator is wrong see wolframalpha.com/input/… $\endgroup$
    – Shobhit
    Commented Oct 5, 2013 at 12:24
  • 1
    $\begingroup$ @Shobhit: It isn't wrong, it just chose a (seemingly arbitrary) specific constant of $\ln(2)$. The only thing I dislike is how both have absorbed the $-\ln(y)$ into the constant. $\endgroup$
    – Clayton
    Commented Oct 5, 2013 at 12:27
  • 1
    $\begingroup$ In you know $$\int\frac{dx}{\sqrt{x^2+1}} = \operatorname{asinh}(x)+C$$then you can do this integral as $\operatorname{asinh}(x/y)+C$. $\endgroup$
    – GEdgar
    Commented Aug 20, 2023 at 17:15

3 Answers 3

2
$\begingroup$

To find out the reason you only requires some basic knowledge of logarithms. In short, there is only a constant difference between these two logarithms.

Since we are integrating with respect to $x$, we regard $y$ as constant and therefore $\ln y$ is const. Let's add the constant term of indefinite integral: \begin{align} \int\frac1{\sqrt{x^2+y^2}}dx & = \ln\left(\frac1y\left(\sqrt{x^2+y^2}+x\right)\right)+C \\ & = \ln\left(\sqrt{x^2+y^2}+x\right)-\ln y+C \\ & = \ln\left(\sqrt{x^2+y^2}+x\right)+C_0 \\ & = \ln\left(\sqrt{x^2+y^2}+x\right)+\ln 2+C' \\ & = \ln\left(2\left(\sqrt{x^2+y^2}+x\right)\right)+C' \\ \end{align} so the two answers are exactly the same.

$\endgroup$
1
$\begingroup$

Hint: after you fix the mistake in the last step, differentiate the function $$x\mapsto \ln\left(\frac{1}{y}\left(\sqrt{x^2+y^2}+x\right)\right)-\ln\left(2\left(\sqrt{x^2+y^2}+x\right)\right)$$ with respect to $x$. It's easy to do so in your head. Also do not forget that you should consider the absolute value appropriately ($\int \frac 1x\mathrm dx)=\ln (|x|)$) and to add an arbitrary constant when you integrate.

$\endgroup$
4
  • $\begingroup$ It's even easier if you expand the right-hand side to see how much cancellation there is and then differentiate :) $\endgroup$
    – Clayton
    Commented Oct 5, 2013 at 12:29
  • $\begingroup$ @Clayton That's exactly what I have in mind. $\endgroup$
    – Git Gud
    Commented Oct 5, 2013 at 12:30
  • $\begingroup$ Ah, I apologize for stating what you already knew. I thought you were implying taking the derivative of the function as it looks was very easy, and I personally didn't want to do that. $\endgroup$
    – Clayton
    Commented Oct 5, 2013 at 12:32
  • $\begingroup$ @Clayton I'm glad for your comment. If it wasn't clear to you what I meant, it won't be for other people either. $\endgroup$
    – Git Gud
    Commented Oct 5, 2013 at 12:32
0
$\begingroup$

One alternative approach via $\sin(ix)=\sinh(x)$ or $\sin^{-1}(ix)=i\sinh^{-1}(x)$ and the known the formula $$ \int{\dfrac{1}{\sqrt{a^2-x^2}}\mathrm dx}=\sin^{-1}\frac{x}{a} $$ then if let $x=it$ $$ \int{\dfrac{1}{\sqrt{x^2+y^2}}\mathrm dx}=i\int{\dfrac{1}{\sqrt{y^2-t^2}}\mathrm dt}=i\sin^{-1}\frac{t}{y}=i\sin^{-1}\left(-i\frac{x}{y}\right)=-i^2\arcsin{\frac{x}{y}}=\arcsin{\frac{x}{y}} $$ where the oddity of $\sin^{-1}(x)$ has been used as well.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .