4

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.

Git Gud
  • 31,356
resgh
  • 303
  • 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. – Ron Gordon Oct 05 '13 at 12:21
  • 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$. – Clayton Oct 05 '13 at 12:21
  • I think the wolfram integrator is wrong see http://www.wolframalpha.com/input/?i=integrate+1%2Fsqrt%28x%5E2%2By%5E2%29&dataset= – Shobhit Oct 05 '13 at 12:24
  • 1
    @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. – Clayton Oct 05 '13 at 12:27
  • @Clayton agreed – Shobhit Oct 05 '13 at 12:28
  • Thi is a table integral in S. K. Stein, Calculus and analytic geometry, 4th ed. NY, St. L., A, B,.., McGraw-Hill, 1987. – user64494 Oct 05 '13 at 12:45
  • 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$. – GEdgar Aug 20 '23 at 17:15

2 Answers2

2

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.

1

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.

Git Gud
  • 31,356
  • It's even easier if you expand the right-hand side to see how much cancellation there is and then differentiate :) – Clayton Oct 05 '13 at 12:29
  • @Clayton That's exactly what I have in mind. – Git Gud Oct 05 '13 at 12:30
  • 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. – Clayton Oct 05 '13 at 12:32
  • @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. – Git Gud Oct 05 '13 at 12:32