Integral of 1 / (x^2 + 2) dx ?

  • Thread starter Thread starter askor
  • Start date Start date
  • Tags Tags
    Dx Integral
askor
Messages
168
Reaction score
9
Mentor note: Moved from technical section, so missing the homework template.
How do you integrate this?

$$\int \frac{1}{x^2 + 2} dx$$

My attempt is $$\ln |x^2 + 2| + C$$
 
Last edited by a moderator:
Physics news on Phys.org
Did you try differentiating your answer to see whether you get the integrand?
 
askor said:
How do you integrate this?

$$\int \frac{1}{x^2 + 2} dx$$

My attempt is $$\ln |x^2 + 2| + C$$
At least this time you showed an attempt. You can always check your work with an indefinite integral by differentiating your answer. If you do this and get the original integrand, your work is correct.

Note that ##\ln|x^2 + 2| = \ln(x^2 + 2)##, so the absolute value isn't needed.

$$\frac d {dx} \left( \ln(x^2 + 2)\right) = \frac 1 {x^2 + 2} \cdot \frac d {dx} (x^2 + 2)$$
Does that work out to your integrand?
 
Last edited:
<Post edited by a mentor, to place more of the burden on the thread starter.>
Your answer is incorrect, for your answer to be valid you would have to alter the original problem in this way.
##
\begin{array}{l}\int _{ }^{ }\frac{2x}{x^2+2}dx\ \left(u=x^2+2,\ dx=\frac{du}{2x}\right)\\

\ln \left|x^2+2\right|+C\\\end{array}
##
obviously modifying the exercise is not valid.
Instead what you have to do is a trigonometric substitution.
 
Last edited by a moderator:
Tapias5000 said:
<Post edited by a mentor, to place more of the burden on the thread starter.>
Your answer is incorrect, for your answer to be valid you would have to alter the original problem in this way.
##
\begin{array}{l}\int _{ }^{ }\frac{2x}{x^2+2}dx\ \left(u=x^2+2,\ dx=\frac{du}{2x}\right)\\

\ln \left|x^2+2\right|+C\\\end{array}
##
obviously modifying the exercise is not valid.
Instead what you have to do is a trigonometric substitution.

This is what I am looking for. Before my question is deleted, I asked for clues and hints. But my question is deleted because I don't write my attempt. I thought trigonometric substitution only work if there is available a square root such as ##\sqrt{x^2 + 2}##.
 
askor said:
This is what I am looking for. Before my question is deleted, I asked for clues and hints. But my question is deleted because I don't write my attempt. I thought trigonometric substitution only work if there is available a square root such as ##\sqrt{x^2 + 2}##.
You don't have to have a root to do it, you could even do a trigonometric substitution in this integral
## \int _{ }^{ }\left(x^2+2\right)dx ## and would get the same response as doing it the quickest way.
 
  • Like
Likes PeroK
.answer is of the form ##Aarctan(Bx)+C##. Work out the constants
 
If you can integrate
\int \frac{1}{x^2+1} dx
you are not far from the answer.
 
  • Like
Likes Delta2
You don't need a trigonometric sub for this one, a substitution of the form ##y=Ax## (what the constant A should be equal to?) and the hint from the previous post is enough to solve the problem.
 
  • #10
askor said:
I thought trigonometric substitution only work if there is available a square root such as ##\sqrt{x^2 + 2}##.
No. Trig substitution is helpful if you have the sum or difference of squared terms - they don't need to be inside a square root.
 
  • Like
Likes Delta2
  • #11
Sorry, I didn't mean to give too much help. Is this an actual homework problem or just a question? From the format it is not clear to me. Thanks.
 
  • #12
The thread probably should have been in the homework forum.
 
  • Like
Likes bob012345
  • #13
vela said:
The thread probably should have been in the homework forum.
Belatedly moved...:oldwink:
 
  • Like
Likes SammyS and bob012345
  • #14
Why not let ##u = x/\sqrt{2}##?
 
  • Like
Likes Delta2
  • #15
mitochan said:
If you can integrate
\int \frac{1}{x^2+1} dx
you are not far from the answer.
Is there some simple easy trick I am missing that makes this much easier than ##\int \frac{1}{x^2+2} dx##? You can tell me privately if you wish.
 
  • #16
bob012345 said:
Is there some simple easy trick I am missing that makes this much easier than ##\int \frac{1}{x^2+2} dx##? You can tell me privately if you wish.
Do you watch blackpenredpen ever? His strategy to integrals is sometimes "wouldn't it be nice if we could take [annoyingly difficult integral] and convert it into [something easy] to integrate. A simple, but hard to spot substitution can actually convert that integral into something that looks A LOT like the quoted integral.

Also the integral of 1/x^2+1 is a standard integral, evaluating to arctan(x) + C.
 
  • #17
Mayhem said:
Do you watch blackpenredpen ever? His strategy to integrals is sometimes "wouldn't it be nice if we could take [annoyingly difficult integral] and convert it into [something easy] to integrate. A simple, but hard to spot substitution can actually convert that integral into something that looks A LOT like the quoted integral.

Also the integral of 1/x^2+1 is a standard integral, evaluating to arctan(x) + C.
I know you can make it look like ##\int \frac{dx}{x^2+1}##with a trivial substitution which was already given in this thread but the question is then is there a clever trick that makes it much easier to integrate than ##\int \frac{dx}{x^2+2}##using other substitutions after that?

I think the issue is for the OP to do the integration and not just look it up as a 'standard' integral. My point is if you do the integration on both, they are the same difficulty are they not?
 
  • #18
bob012345 said:
I know you can make it look like ##\int \frac{dx}{x^2+1}##with a trivial substitution which was already given in this thread but the question is then is there a clever trick that makes it much easier to integrate than ##\int \frac{dx}{x^2+2}##using other substitutions after that?

I think the issue is for the OP to do the integration and not just look it up as a 'standard' integral. My point is if you do the integration on both, they are the same difficulty are they not?
Why would you need a trig substitution? Once you do the clever substitution, the answer practically gives itself.

I have no idea how to arrive at arctan(x) by integrating that. But it is actually fairly easy to prove that (arctan(x))' = 1/x2+2. Thus, using F'(x)=f(x), you can argue your case easily. Maybe you can find a trick to rewrite the integral such that you can do a partial fraction decomposition, but that just seems like a lot of work.
 
  • #19
Mayhem said:
Why would you need a trig substitution? Once you do the clever substitution, the answer practically gives itself.

I have no idea how to arrive at arctan(x) by integrating that. But it is actually fairly easy to prove that (arctan(x))' = 1/x2+2. Thus, using F'(x)=f(x), you can argue your case easily. Maybe you can find a trick to rewrite the integral such that you can do a partial fraction decomposition, but that just seems like a lot of work.
My table of Integrals has the general case ##\int \frac{dx}{x^2+a^2}## as a 'standard' integral too, not just the case where ##a=1##. But I think this being a Calculus homework problem it is expected of the OP to figure out how to do it. Hints were given above.
 
  • #20
Mayhem said:
Why would you need a trig substitution? Once you do the clever substitution, the answer practically gives itself.
I'm intrigued. If the answer is an inverse trig function, then how can trig functions be avoided?
 
  • #21
PeroK said:
I'm intrigued. If the answer is an inverse trig function, then how can trig functions be avoided?
Perhaps the confusion lies in me not evaluating 1/x^2+1 manually but simply using the standard integral. Thinking about it, that integral could probably be solved with trig substitution.
 
  • #22
Mayhem said:
Why would you need a trig substitution?
See below.
Mayhem said:
I have no idea how to arrive at arctan(x) by integrating that.
It can be done very easily by using a trig substitution; namely ##x = \tan(\theta)##. With this substitution, the integration becomes trivial.
Mayhem said:
But it is actually fairly easy to prove that (arctan(x))' = 1/x2+2
You need more parentheses. Taken literally, what you have written (twice) would be interpreted to mean this:
$$\frac 1 {x^2} + 2$$

Without LaTeX, the above should be written as 1/(x^2 + 2).
 
  • Like
Likes SammyS
  • #23
PeroK said:
I'm intrigued. If the answer is an inverse trig function, then how can trig functions be avoided?
You could use imaginary numbers then partial fractions and you will get 2 logarithms, so you can skip the trigonometric substitution in this case.
 
  • Like
Likes Mayhem and PeroK
  • #24
Tapias5000 said:
You could use imaginary numbers then partial fractions and you will get 2 logarithms, so you can skip the trigonometric substitution in this case.
How about an unrelated example so as not to directly solve this integral but to illustrate the principle?
 
  • #25
bob012345 said:
How about an unrelated example so as not to directly solve this integral but to illustrate the principle?
The main part is the algebra involved. Suppose we have ##\frac 1 {x^2 + 9}##.

$$\frac 1 {x^2 + 9} = \frac 1 {(x + 3i)(x - 3i)} = \frac A {x + 3i} + \frac B {x - 3i}$$
After finding the constants A and B it's relatively simple to compute the integral ##\int \frac {dx}{x^2 + 9}## as it can now be written as two simpler integrals.
 
  • Like
Likes bob012345 and Tapias5000
  • #26
Tapias5000 said:
You could use imaginary numbers then partial fractions and you will get 2 logarithms, so you can skip the trigonometric substitution in this case.
And it's left as an exercise to the reader to show that one solution can be transformed into the other.
 
  • Like
Likes Tapias5000 and PeroK
  • #27
bob012345 said:
How about an unrelated example so as not to directly solve this integral but to illustrate the principle?
That's the idea, it also works when x^2 is being multiplied by a number like for example:

## \int _{ }^{ }\frac{1}{5x^2+9}dx ##
## 5x^2+9=0 ##
##x^2=-\frac{9}{5} ##
## x=\frac{3i}{\sqrt{5}},\ \ x=-\frac{3i}{\sqrt{5}}\ →\ \left(\sqrt{5}x-3i\right)\left(\sqrt{5}x+3i\right)##
##\frac{1}{\left(\sqrt{5}x-3i\right)\left(\sqrt{5}x+3i\right)}=\frac{A}{\left(\sqrt{5}x-3i\right)}+\frac{B}{\left(\sqrt{5}x+3i\right)} ##

Basically we can generalize this type of integral to:

## \int _{ }^{ }\frac{1}{nx^2+a}dx ## where n≠0 and a≠0 where a and n are a number with a positive sign
obtaining ##\int _{ }^{ }\frac{1}{\left(\sqrt{n}x-\sqrt{a}i\right)\left(\sqrt{n}x+\sqrt{a}i\right)}dx ##
 
  • Like
Likes bob012345
  • #28
Mark44 said:
The main part is the algebra involved. Suppose we have ##\frac 1 {x^2 + 9}##.

$$\frac 1 {x^2 + 9} = \frac 1 {(x + 3i)(x - 3i)} = \frac A {x + 3i} + \frac B {x - 3i}$$
After finding the constants A and B it's relatively simple to compute the integral ##\int \frac {dx}{x^2 + 9}## as it can now be written as two simpler integrals.
I assume the integration is just over real numbers and the ##i## is treated as a constant? Don't answer I'll figure that out...but frankly, this seems to be a lot harder way to do it.
 
Last edited:
  • #29
Mark44 said:
The main part is the algebra involved. Suppose we have ##\frac 1 {x^2 + 9}##.

$$\frac 1 {x^2 + 9} = \frac 1 {(x + 3i)(x - 3i)} = \frac A {x + 3i} + \frac B {x - 3i}$$
After finding the constants A and B it's relatively simple to compute the integral ##\int \frac {dx}{x^2 + 9}## as it can now be written as two simpler integrals.
I tried but I cannot see how ##A,B## are constants?
 
  • #30
@bob012345, multiply the identity ##\dfrac{1}{(x+3i)(x-3i)} = \dfrac{A}{x + 3i} + \dfrac{B}{x-3i}## by the factor ##(x-3i)##, and then set ##x = 3i## (you can do this because the identity holds for all ##x##). And do a similar thing to find ##A##.
 
  • #31
ergospherical said:
@bob012345, multiply the identity ##\dfrac{1}{(x+3i)(x-3i)} = \dfrac{A}{x + 3i} + \dfrac{B}{x-3i}## by the factor ##(x-3i)##, and then set ##x = 3i## (you can do this because the identity holds for all ##x##). And do a similar thing to find ##A##.
I originally assumed ##A,B## were real leading to trouble. That's when I made that comment. I realized later they might be complex but it was too late. Thanks!
 
  • #32
bob012345 said:
I tried but I cannot see how ##A,B## are constants?
Both are imaginary constants. I get A = i/6 and B = -i/6.
 
  • Like
Likes bob012345
  • #33
Mark44 said:
Both are imaginary constants. I get A = i/6 and B = -i/6.
I got that too. Now for fun I'll try the original integral this way but quietly...
 
  • #34
In my class I taught this as a trig substitution. I.e. we know (at least) two basic trig identities with squares in them: sin^2+cos^2=1, and 1+tan^2 = sec^2, (obtained by dividing the first one by cos^2). the first one gives cos^2 = 1-sin^2, and so we have identities that can be used to simplify 1-x^2 as well as 1+x^2, by putting x = sin(t) or x = tan(t).

To integrate dx/(1+x^2), we put x = tan(t), and dx = sec^2(t)dt, and get the integral as t. and since x= tan(t), we have t = arctan(x).

in your case you have 2+x^2 which looks like 1+tan^2, except off by a constant. now constant multipliers do no harm so you could try setting 2+x^2 = c(1+tan^2(t)), and go from there.

complex methods are also fun and illuminating, but sometimes may give non real answers. of course if you know e^it = cos(t) + i sin (t), you can often find your way back.

In fact when you look at complex numbers and complex path integrals, log and arctan are somewhat the same, except for interchanging i and -i with 0 and infinity, since integration of 1/(1+z^2) behaves the same as you go around i and -i as integrating 1/z does as you go around 0 and infinity!
 
  • Like
Likes bob012345 and PeroK
  • #35
bob012345 said:
I got that too. Now for fun I'll try the original integral this way but quietly...
Finished and got the same results but converting from the natural log form was not trivial unless one already knew about the relationship as mentioned by @mathwonk above, which I didn't but now I do. So, yes, it can be done without a trig substitution but to me, not as easily.

But in a way both are doing similar things in that one is mapping the problem from a one dimensional space to a two dimensional space, the ##x,y## plane with an angle in one case and the complex plane in the other.
 
  • #36
bob012345 said:
Is there some simple easy trick I am missing that makes this much easier than ? You can tell me privately if you wish.
Please take a look at attached calculation.
2021-10-09 11.27.54.jpg
 
Last edited by a moderator:
  • Like
Likes bob012345
  • #37
mitochan said:
Please take a look at attached calculation.
Thanks. It does seem simpler with the ##1## in the denominator.
 
Last edited:
  • #38
ergospherical said:
@bob012345, multiply the identity ##\dfrac{1}{(x+3i)(x-3i)} = \dfrac{A}{x + 3i} + \dfrac{B}{x-3i}## by the factor ##(x-3i)##, and then set ##x = 3i## (you can do this because the identity holds for all ##x##). And do a similar thing to find ##A##.
But for x=3i makes some of the denominators of the identity zero...
 
  • #39
Delta2 said:
But for x=3i makes some of the denominators of the identity zero...
If you multiply both sides by one of the factors, say ##x-3i##, solve for ##A## and then set ##x=3i## it works. Cancel those terms before you make the substitution.
 
  • #40
Delta2 said:
But for x=3i makes some of the denominators of the identity zero...
That's the idea, so you can find A, then do x=-3i and find B.
 
  • #41
Tapias5000 said:
That's the idea, so you can find A, then do x=-3i and find B.
I think it is being suggested this is like the proof ##1=2##.
 
  • #42
bob012345 said:
If you multiply both sides by one of the factors, say ##x-3i##, solve for ##A## and then set ##x=3i## it works. Cancel those terms before you make the substitution.
Emmm, by multiplying both sides by (x-3i) and then making x=3i, you will not fall into any error, it is valid to do so.
 
  • #43
It should not have been left to the reader to do first the multiplication of the identity by x-3i, it should have been explicitly mentioned by @ergospherical :D.
 
  • #44
Delta2 said:
But for x=3i makes some of the denominators of the identity zero...
You can think of it like this:
\begin{align*}
\lim_{x \to 3i} (x-3i)\frac{1}{(x-3i)(x+3i)} &= \lim_{x \to 3i} (x-3i)\left[\frac{A}{x-3i}+\frac{B}{x+3i}\right] \\
\lim_{x \to 3i} \frac{1}{x+3i} &= \lim_{x \to 3i} \left[A+B\frac{x-3i}{x+3i}\right] \\
\end{align*} After canceling the factors of ##x-3i##, the functions are continuous at ##x=3i##, so you can evaluate the limit by simply plugging in the value.
 
  • Like
Likes SammyS
  • #45
mitochan said:
Please take a look at attached calculation.
This is exactly how I would do it.
 
  • #46
bob012345 said:
I think it is being suggested this is like the proof ##1=2##.
No, not at all. I think you might be referring to the post by ergospherical.
ergospherical said:
multiply the identity ##\dfrac{1}{(x+3i)(x-3i)} = \dfrac{A}{x + 3i} + \dfrac{B}{x-3i}## by the factor ##(x-3i)##, and then set ##x = 3i## (you can do this because the identity holds for all ##x##). And do a similar thing to find ##A##.
An important point is that the equation above is an identity: one that is is true for all values of the variable x, excepting only ##x = \pm 3i##. For any values of x other than these two, we can multiply both sides of the equation by ##(x + 3i)(x - 3i)## to get this equation:
##1 = A(x - 3i) + B(x + 3i)##
The new equation is still an identity: it must be true for any value of x. The way I chose to go is to solve for A and B like so:
##1 = (A + B)x - 3i(A - B)
For this to be true for all values of x, A + B must be 0 (there is no x term on the left side), and -3i(A - B) = 1.
Solve these two equations for A and B, and Bob's your uncle.
 
Last edited:
  • Like
Likes benorin, bob012345 and Tapias5000
  • #47
Delta2 said:
It should not have been left to the reader to do first the multiplication of the identity by x-3i, it should have been explicitly mentioned by @ergospherical :D.
hehe, I use Quora more so my answers are usually complete aum, I'm not used to this forum at all hehe. :sorry:
 
  • #48
bob012345 said:
Thanks. It does seem simpler with the ##1## in the denominator.
Then
\int \frac{dx}{x^2+2}= \frac{1}{\sqrt{2}}\int\frac{d\frac{x}{\sqrt{2}}}{(\frac{x}{\sqrt{2}})^2+1}=...
 
Last edited:
  • Like
Likes benorin and Delta2
  • #49
mitochan said:
Then
\int \frac{dx}{x^2+2}= \frac{1}{\sqrt{2}}\int\frac{d\frac{x}{\sqrt{2}}}{(\frac{x}{\sqrt{2}})^2+1}=...
I just used a basic trig with ##tan(\theta)= \large\frac{x}{a}## and it worked fine.
 
  • #50
bob012345 said:
I just used a basic trig with ##tan(\theta)= \large\frac{x}{a}## and it worked fine.
The image in post #36 shows why this substitution works. For ##x^2 + 2##, the length of the leg adjacent to the angle is ##\sqrt 2## rather than 1.
 
Back
Top