Some Issues with Partial Fractions and Integration of Rational Functions.
Many partial fractions decompositions taken out of calculus texts can be easily done with Apart
Making a slight change in the denominator can become a problem since the denominator may not factor without identifying the extension of the rationals that is needed to factor the denominator.
Why y2[[2,1]]
? Evaluate FullForm[y2[[2,1]]
] to find out.
Fortunately, you don't need to use Apart to integrate a rational function, but another problem emerges. Mathematica doesn't assume that you are only interested in real valued functions.
This makes plotting an antiderivative like a problem when the argument to a log term become negative.
Here is one way to transform the integration result into the one we expect to see in calculus.
The graph doesn't show it, but dirverges to -∞ as x approaches either -3 or 5.
There is a package called RealOnly that puts you into a real-only environment, but loading it doesn't solve the problem we ran into above.
This package can be useful in other calculus contexts. For example, the cube root of a negative real number is complex and so plotting y= can be a problem
Now the cube root of -8 will be -2:
Created by Mathematica (March 9, 2006) |