Antiderivative of a rational function

Click For Summary
The discussion revolves around finding the antiderivative of the rational function \( \int \frac{x^2+8x+4}{x^2+4x+8} dx \). The user is seeking help to identify an error in their lengthy solution, which involves polynomial division and variable substitution, resulting in a slight discrepancy with the book's answer. Key points include the realization that the absolute value signs in the logarithmic expression are unnecessary, as the argument is always positive. The discussion also touches on alternative methods for solving the integral, although the user prefers to focus on correcting their current approach. Ultimately, the user is looking for clarity on their calculations rather than alternative solutions.
Rectifier
Gold Member
Messages
313
Reaction score
4
I am trying to find primitives to the rational function below but my answer differs from the answer in the book only slightly and now, I am asking for your help to find the error in my solution. This solution is long since I try to include all the steps in the process.

The problem

$$ \int \frac{x^2+8x+4}{x^2+4x+8} dx $$

Relevant equations

$$ \int \frac{1}{x} dx = \ln |x| + C \\
\int \frac{1}{x^2+1} dx =arctan x + C
$$

The attempt at a solution

I am starting with a polynomial division and rewrite the fraction as
## \int \frac{x^2+8x+4}{x^2+4x+8} dx = \int 1 + \frac{4x-4}{x^2+4x+8} dx ##

Since divisor is irreducible, I must complete the square and adapt the quotient to use the standard formula for a function that has a primitive which is ##arctan x +C## as follows.

$$ \int 1 + \frac{4x-4}{x^2+4x+8} dx = x + \int \frac{4x-4}{(x+2)^2+4} dx \\ x + \int \frac{4(x-1)}{\frac{4}{4}(x+2)^2+4} dx \\ x + \int \frac{4(x-1)}{4 \left( \frac{(x+2)^2}{4}+1 \right)} dx \\ x + \int \frac{4(x-1)}{4 \left( \left( \frac{x+2}{2} \right)^2+1 \right)} dx \\ x + \int \frac{x-1}{ \left( \frac{x+2}{2} \right)^2+1} dx $$

I split the qotent:
$$ x + \int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx - \int \frac{1}{ \left(\frac{x+2}{2} \right)^2+1} dx $$

Lets focus on the part that has ##x## as divisor.

$$ \int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx $$

I perform a variable substitutution ## [t= \frac{x+2}{2} \Leftrightarrow x = 2t-2, \frac{dt}{dx} = \frac{1}{2} \Leftrightarrow 2 dt = dx] ##. That results in

$$\int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx = 2 \left( \int \frac{2t-2}{ t^2+1} dt \right) = 2 \int \frac{2t}{ t^2+1} dt - 2 \cdot 2 \int \frac{1}{ t^2+1} dt$$

I split the quotient once more and focus on the part that has ##2t## as divisor where I make one more variable substitution ##[g=t^2+1, \frac{dg}{dt}=2t \Leftrightarrow 2t dt = dg]##

$$ 2 \int \frac{2t}{ t^2+1} dt = 2 \int \frac{1}{g} dg = 2 \ln|g| + C = 2 \ln|t^2+1| + C = \ln| \left(\frac{x+2}{2} \right)^2 + 1|+ C$$
I use back-substitution in the last steps.Now, let's add the rest of the integrals that we didn't focus on before:

$$ x + \int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx - \int \frac{1}{ \left(\frac{x+2}{2} \right)^2+1} dx \\ x + \ \ 2 \int \frac{2t}{ t^2+1} dt - 2 \cdot 2 \int \frac{1}{ t^2+1} dt - \int \frac{1}{ \left(\frac{x+2}{2} \right)^2+1}\\ x + \ \ 2\ln| \left(\frac{x+2}{2} \right)^2 + 1| - 4 \arctan t - 2 \arctan(\left(\frac{x+2}{2} \right)) + C \\ x + \ \ 2\ln| \left(\frac{x+2}{2} \right)^2 + 1| - 6 \arctan(\left(\frac{x+2}{2} \right)) + C$$

I am not interested in alternative ways to solve the problem but to find the error in my calculations.

Please help.

The part that differs from the answer in my book is inside ## \ln ## and not by much (see spoiler)
It differs only by a multiple of 4. In my book the contents of ln are: 2 \ln( x^2 + 4x + 8 )
.
 
Physics news on Phys.org
The two answers are equivalent. It is an indefinite integral so any multiplicative factors in the argument of the ##\ln## can simply be absorbed into the undetermined constant i.e. ##\ln (4 f(x)) + C = \ln (f(x)) + \ln 4 + C = \ln (f(x)) + C'##.
 
  • Like
Likes Rectifier
Rectifier said:
I am trying to find primitives to the rational function below but my answer differs from the answer in the book only slightly and now, I am asking for your help to find the error in my solution. This solution is long since I try to include all the steps in the process.

The problem

$$ \int \frac{x^2+8x+4}{x^2+4x+8} dx $$

Relevant equations

$$ \int \frac{1}{x} dx = \ln |x| + C \\
\int \frac{1}{x^2+1} dx =arctan x + C
$$

The attempt at a solution

I am starting with a polynomial division and rewrite the fraction as
## \int \frac{x^2+8x+4}{x^2+4x+8} dx = \int 1 + \frac{4x-4}{x^2+4x+8} dx ##

Since divisor is irreducible, I must complete the square and adapt the quotient to use the standard formula for a function that has a primitive which is ##arctan x +C## as follows.

$$ \int 1 + \frac{4x-4}{x^2+4x+8} dx = x + \int \frac{4x-4}{(x+2)^2+4} dx \\ x + \int \frac{4(x-1)}{\frac{4}{4}(x+2)^2+4} dx \\ x + \int \frac{4(x-1)}{4 \left( \frac{(x+2)^2}{4}+1 \right)} dx \\ x + \int \frac{4(x-1)}{4 \left( \left( \frac{x+2}{2} \right)^2+1 \right)} dx \\ x + \int \frac{x-1}{ \left( \frac{x+2}{2} \right)^2+1} dx $$

I split the qotent:
$$ x + \int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx - \int \frac{1}{ \left(\frac{x+2}{2} \right)^2+1} dx $$

Lets focus on the part that has ##x## as divisor.

$$ \int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx $$

I perform a variable substitutution ## [t= \frac{x+2}{2} \Leftrightarrow x = 2t-2, \frac{dt}{dx} = \frac{1}{2} \Leftrightarrow 2 dt = dx] ##. That results in

$$\int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx = 2 \left( \int \frac{2t-2}{ t^2+1} dt \right) = 2 \int \frac{2t}{ t^2+1} dt - 2 \cdot 2 \int \frac{1}{ t^2+1} dt$$

I split the quotient once more and focus on the part that has ##2t## as divisor where I make one more variable substitution ##[g=t^2+1, \frac{dg}{dt}=2t \Leftrightarrow 2t dt = dg]##

$$ 2 \int \frac{2t}{ t^2+1} dt = 2 \int \frac{1}{g} dg = 2 \ln|g| + C = 2 \ln|t^2+1| + C = \ln| \left(\frac{x+2}{2} \right)^2 + 1|+ C$$
I use back-substitution in the last steps.Now, let's add the rest of the integrals that we didn't focus on before:

$$ x + \int \frac{x}{ \left( \frac{x+2}{2} \right)^2+1} dx - \int \frac{1}{ \left(\frac{x+2}{2} \right)^2+1} dx \\ x + \ \ 2 \int \frac{2t}{ t^2+1} dt - 2 \cdot 2 \int \frac{1}{ t^2+1} dt - \int \frac{1}{ \left(\frac{x+2}{2} \right)^2+1}\\ x + \ \ 2\ln| \left(\frac{x+2}{2} \right)^2 + 1| - 4 \arctan t - 2 \arctan(\left(\frac{x+2}{2} \right)) + C \\ x + \ \ 2\ln| \left(\frac{x+2}{2} \right)^2 + 1| - 6 \arctan(\left(\frac{x+2}{2} \right)) + C$$

I am not interested in alternative ways to solve the problem but to find the error in my calculations.

Please help.

The part that differs from the answer in my book is inside ## \ln ## and not by much (see spoiler)
It differs only by a multiple of 4. In my book the contents of ln are: 2 \ln( x^2 + 4x + 8 )
.

You have unnecessary absolute-value signs ##| \ldots |##, and these get in the way of further simplification. In fact,
$$\int \frac{2t \, dt}{t^2+1} = \ln(t^2+1)$$
with no need for ##| \ldots |## because ##t^2+1 \geq 1## is always positive, and always has a non-negative logarithm.
 
  • Like
Likes Rectifier
Thank you for your help everyone.

@Ray Vickson you wrote something before that that I didn't manage to read on how to solve that more efficiently. What steps are unnecessary here?
 
Rectifier said:
Thank you for your help everyone.

@Ray Vickson you wrote something before that that I didn't manage to read on how to solve that more efficiently. What steps are unnecessary here?

I deleted it, because after posting (briefly) I noticed your statement that you were not interested in seeing other ways of doing it---only in finding your mistakes, which turned out to not be mistakes after all. However, what I said was:
$$\frac{4x-4}{(x+2)^2+4} dx = 2 \frac{ (2x+4) -6}{(x+2)^2+4} dx = 2\frac{(2x+4)\, dx}{(x+2)^2+4} - \frac{12\, dx}{(x+2)^2+4} .$$
The first term has the form ##2 \, df/f## while the second one is closely related to ##dt/(t^2+1)##.
 
  • Like
Likes Rectifier
Oh, thank you for reposting that! I wrote that last line since I often get alternative ways of solving the problem without them mentioning why my last solution produced a strange/wrong answer so I end up doing the same mistakes over and over again.
 
Question: A clock's minute hand has length 4 and its hour hand has length 3. What is the distance between the tips at the moment when it is increasing most rapidly?(Putnam Exam Question) Answer: Making assumption that both the hands moves at constant angular velocities, the answer is ## \sqrt{7} .## But don't you think this assumption is somewhat doubtful and wrong?

Similar threads

  • · Replies 105 ·
4
Replies
105
Views
6K
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
Replies
7
Views
2K