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.

  • $\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 Oct 5 '13 at 12:21
  • $\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 Oct 5 '13 at 12:21
  • $\begingroup$ I think the wolfram integrator is wrong see wolframalpha.com/input/… $\endgroup$ – Shobhit Oct 5 '13 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 Oct 5 '13 at 12:27
  • $\begingroup$ @Clayton agreed $\endgroup$ – Shobhit Oct 5 '13 at 12:28

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.