Numerical Integration with constants

386 Views Asked by At

I am having trouble trying to integrate the following integral numerically because of the constant z $$\int_{-5}^5(x^2+z^2)^{-1}(x^2+25+z^2)^{-0.5}dx$$ Is there any way to evaluate this integral on Sage?

1

There are 1 best solutions below

0
On BEST ANSWER

As Ian commented, using the substitution $u=\frac{x}{\sqrt{x^2+25+z^2}}$, you should end with $$I=\int(x^2+z^2)^{-1}(x^2+25+z^2)^{-\frac12}\,dx=\int \frac{du}{25 u^2+z^2}=\frac{\tan ^{-1}\left(\frac{5 u}{z}\right)}{5 z}$$

Back to $x$ $$I=\frac{\tan ^{-1}\left(\frac{5 x}{z \sqrt{x^2+z^2+25}}\right)}{5 z}$$ and $$J(a)=\int_{-a}^{+a}(x^2+z^2)^{-1}(x^2+25+z^2)^{-\frac12}\,dx=\frac{2 \tan ^{-1}\left(\frac{5 a}{z \sqrt{a^2+z^2+25}}\right)}{5 z}$$ What is seems is that you search for $z$ such that $$k=J(5)=\frac{2 \tan ^{-1}\left(\frac{25}{z \sqrt{z^2+50}}\right)}{5 z}$$ where $k$ is known.

This is a transcendental equation and you will need some numerical method (Newton would be the simplest to use). The problem is that you need a starting guess $z_0$.

Using a series expansion built at $z=0$, you could get $$k=\frac{\pi }{5 z}-\frac{2 \sqrt{2}}{25}+\frac{z^2}{375 \sqrt{2}}+O\left(z^4\right)$$ and using series reversion $$z=\frac{\pi }{5 k}-\frac{2 \sqrt{2} \pi }{125 k^2}+\frac{8 \pi }{3125 k^3}+O\left(\frac{1}{k^4}\right)$$ Using this value for $z_0$, let us try for $k=0.567$. The iterates would be $$\left( \begin{array}{cc} n & z_n \\ 0 & 0.9311508109 \\ 1 & 0.9259359776 \\ 2 & 0.9259652138 \\ 3 & 0.9259652147 \end{array} \right)$$