4

For checking my calculations, I generally use Wolfram Alpha or a similar tool. Today, I wanted to check the following integral:

$$\int {\frac{1}{{9 - {x^2}}}} dx$$

From my calculations, using partial fraction decomposition, I ended up with the following answer:

$$\int {\frac{1}{{9 - {x^2}}}} {\text{ }}dx = \frac{1}{6}\left( {\ln (x + 3) - \ln (x - 3)} \right) + C$$

This is also the result returned when using the calculator at http://www.integral-calculator.com/

Using Wolfram Alpha, I however got something slightly different:

$$\int {\frac{1}{{9 - {x^2}}}} {\text{ }}dx = \frac{1}{6}\left( {\ln (x + 3) - \ln (3 - x)} \right) + C$$

Using the "step-by-step solution" feature, WA uses a trignometric hyperbolic function to get to the answer:

$$\int {\frac{1}{{9 - {x^2}}}} {\text{ dx = }}\frac{1}{3}{\tanh ^{ - 1}}(\frac{x}{3}) + C = \frac{1}{6}\left( {\ln (x + 3) - \ln (3 - x)} \right) + C$$

Using Geogebra gives the follwing result, identical to my own result except in using absolute values for the logarithmic functions, thus expanding the domain to values of x smaller than 3 :

$$\int {\frac{1}{{9 - {x^2}}}} {\text{ }}dx = \frac{1}{6}\ln (\left| {x + 3} \right|) - \frac{1}{6}\ln (\left| {x - 3} \right|)$$

Lastly, using the Wolfram Mathematica Online Integrator gives the following:

$$\int {\frac{1}{{9 - {x^2}}}} {\text{ }}dx = \frac{1}{6}\left( {\ln ( - x - 3) - \ln (x - 3)} \right)$$

Using Geogebra to plot the graphs for the various variations above, I observe the following:

  • The first expression (my original result) is defined for $x \geq3$. The value goes to infinity as x goes towards 3.

  • The expression returned by Geogebra is defined for all values of x except for x=3 and x= -3. The value goes to positive and negative infinity at these points, respectively.

  • The expression returned by Wolfram Alpha is defined for values between x=3 and x=-3. The value goes to positive and negative infinity at these points, respectively.

  • Geogebra refuses to plot the graph of the expression returned by Wolfram Mathematia Online Integrator, apparently because either logarithmic term is undefined when the other is not.

What is going on here? If all of the expressions are above are equivalent (although to me, they appear to be not), is there one that is most reasonable?

jarlemag
  • 175
  • 5
  • Several of the expressions are completely equivalent. Others have variation in their domains. Here you should expect to have three significantly different antiderivatives, one on $(-\infty,-3)$, one on $(-3,3)$, and one on $(3,\infty)$. This is similar to how $1/x$ has two antiderivatives, one on $(-\infty,0)$ and one on $(0,\infty)$. – Ian Mar 31 '15 at 22:12
  • For example, if you want to calculate $\int_{-1}^1 \frac{1}{9-x^2} dx$, you do the partial fractions to get $\frac{1}{6} \left ( \frac{1}{x+3} - \frac{1}{x-3} \right )$. Now in that interval, $x+3>0$ while $x-3<0$, so $\ln(|x+3|)=\ln(x+3)$ while $\ln(|x-3|)=\ln(3-x)$. Hence Wolfram's expression is correct when you are dealing with $x \in (-3,3)$. – Ian Mar 31 '15 at 22:17
  • Thanks! That's very helpful. I edited my question slightly in response to your comments. – jarlemag Mar 31 '15 at 22:21
  • the one with the absolute values is the responsible answer. The antiderivative of $1/x$ is $\log |x|.$ Easy to check – Will Jagy Mar 31 '15 at 22:29
  • @WillJagy There is still a constant of integration change that happens when you go through zero. That is, the antiderivative is $\ln(-x)+c_1$ for $x<0$ and $\ln(x)+c_2$ for $x>0$. – Ian Mar 31 '15 at 23:02

2 Answers2

1

Notice all these solutions vary in very specific ways that are "isomorphic" under differentiation under the integral sign. For example, the Alpha and Online integrator solutions are scalar multiples of the arguments under composition of functions: $\frac{1}{6}\left( {\ln (x + 3) - \ln (3 - x)} \right) + C$= $\frac{1}{6}\left( {\ln \frac{(x + 3)}{(3 - x)}} \right) + C$=$\frac{1}{6}\left( {\ln \frac{-1(-x - 3)}{(x - 3)}} \right) + C$

Much more significantly,though,since you evaluated the integral as an indefinite integral, you left an infinite number of possible choices for the domain of definition and that's really important in defining the chosen closed form solution. While all these forms are equivalent as antiderivatives from the original functions, they all yield very different integrals on different domains of integration.

If you run all these integrals again on a specific chosen domain, I think you'll find they all agree if solved in closed form. Try it.

1

The integral expression that defines the log function is

$$\log x=\int_1^x \frac{dt}{t}$$

for $x>0$. $\,$Obvioulsy, for $x<0$ we may write the equivalent forms

$$\begin{align} \log (-x)&=\int_1^{-x} \frac{dt}{t}\\\\ &=\int_{-1}^{x} \frac{dt}{t}\\\\ &=-\int_{x}^{-1} \frac{dt}{t} \end{align}$$

As pointed out by Mathemagician1234, one must carefully consider the domain of integration when expressing the correct anti-derivative of $\frac{1}{x}$. Notice that for both $x>0$ and $x<0$ we have

$$\log |x| = \int_1^{|x|} \frac{dt}{t}$$

To that end, perhaps the "best" antiderivative for $\frac{1}{9-x^2}$ is

$$\begin{align} \int \frac{1}{9-x^2} dx &=\frac16 \int \left(\frac{1}{x+3}-\frac{1}{x-3}\right)dx\\\\ &=\frac16\,\log\left(\frac{|x+3|}{|x-3|}\right)+C\\\\ &=\frac16 \begin{cases} \log\left(\frac{x+3}{x-3}\right)+C, & \text{if $x>3$} \\\\ \log\left(\frac{x+3}{3-x}\right)+C, & \text{if $|x|<3$} \\\\ \log\left(\frac{-(x+3)}{x-3}\right)+C, & \text{if $x<-3$} \end{cases} \end{align}$$


Here is one more simple example. Suppose we have the integral $\int_{-5}^x \frac{dt}{t}$ where $x<0$. We can split this into the following

$$\begin{align} \int_{-5}^x&=\int_{-5}^{-1} \frac{dt}{t}+\int_{-1}^{x} \frac{dt}{t}\\ &=-\log(-(-5))+\log(-x)\\ &=\log|x|-\log|-5| \end{align}$$

Mark Viola
  • 184,670