# Antiderivative of a rational function

• Rectifier
In summary: C= \ln(t^2+1)+C= \ln \left(\frac{(x+2)^2}{4}+1 \right)+C= \ln \left(\frac{(x+2)^2+4}{4} \right)+C= \ln \left(\frac{(x+2)^2+4}{4} \right)+C= \ln \left(\frac{(x+2)^2+4}{4} \right)+C$$I am trying to find primitives to the rational function below but my Rectifier Gold Member 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 ) . 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'##. 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. 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)##.

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.

## 1. What is the definition of an antiderivative of a rational function?

An antiderivative of a rational function is a function whose derivative is equal to the original rational function. In other words, it is the inverse operation of differentiation.

## 2. How do you find the antiderivative of a rational function?

To find the antiderivative of a rational function, you can use the power rule and the sum and difference rules from calculus. You can also use integration by substitution or integration by parts.

## 3. Can all rational functions be integrated?

No, not all rational functions can be integrated. Some rational functions have antiderivatives that cannot be expressed in terms of elementary functions. These are known as improper rational functions.

## 4. What is the difference between an antiderivative and an indefinite integral?

An antiderivative is a function that is the inverse of a derivative, while an indefinite integral is a family of functions that differ by a constant. In other words, an antiderivative is a specific function, while an indefinite integral is a set of functions.

## 5. Can you give an example of finding the antiderivative of a rational function?

Yes, for example, the antiderivative of f(x) = (2x+3)/(x^2+1) is F(x) = ln(x^2+1) + C, where C is a constant. This can be found using the power rule and the sum rule for integration.

Replies
3
Views
771
Replies
22
Views
2K
Replies
4
Views
1K
Replies
8
Views
1K
Replies
16
Views
1K
Replies
7
Views
1K
Replies
12
Views
2K
Replies
20
Views
978
Replies
12
Views
1K
Replies
5
Views
2K