3

$$\begin{align} \int{\frac{x^2+1}{x^4-x^2+1}}dx&=\int{\frac{1+\frac{1}{x^2}}{x^2-1+\frac{1}{x^2}}}dx\\ &=\int{\frac{1+\frac{1}{x^2}}{(x-\frac{1}{x})^2+1}}dx\\ &=\int{\frac{1}{u^2+1}}du \quad(u=x-\frac{1}{x})\\ &=\arctan(u)+C\\ &=\arctan(x-\frac{1}{x})+C \end{align}$$ The image of the integral is:

When I check it using wolfram, the result is $\arctan(\frac{x}{1-x^2})+C$ https://www.wolframalpha.com/input/?i2d=true&i=%5Cint%5C%28%7B%29Divide%5BPower%5Bx%2C2%5D%2B1%2CPower%5Bx%2C4%5D-Power%5Bx%2C2%5D%2B1%5D%5C%28%7D%29 It seems Wolfram calculates this integral like this: $$\begin{align} \int{\frac{x^2+1}{x^4-x^2+1}}dx&=\int\frac{x^2+1}{(x^2-1)^2+x^2}dx\\ &=\int\frac{\frac{x^2+1}{(x^2-1)^2}}{1+\frac{x^2}{(x^2-1)^2}}dx\\ &=\int{\frac{1}{1+u^2}}du \quad(u=\frac{x}{1-x^2})\\ &=\arctan(u)+C\\ &=\arctan(\frac{x}{1-x^2})+C \end{align}$$

Which solution is correct?

Dan Li
  • 93
  • 3
    $\arctan\left(x-\frac1x\right)=\arctan\left(\frac{x^2-1}x\right)=\frac\pi2-\arctan\left(\frac{x}{x^2-1}\right)=\frac\pi2+\arctan\left(\frac{x}{1-x^2}\right)$ – robjohn Aug 18 '21 at 15:18

2 Answers2

6

Your answer is$$f(x)=\arctan\left(x-\frac1x\right).$$If you differentiate it, you will get indeed$$\dfrac{x^2+1}{x^4-x^2+1}.\tag1$$But $f$ is undefined at $0$. Besides, $\lim_{x\to0^+}f(x)\ne\lim_{x\to0^-}f(x)$.

On the other hand, if$$g(x)=\arctan\left(\frac x{1-x^2}\right),$$then, again, if you differentiate it, you will get indeed $(1)$. But $g$ is undefined at $\pm1$.

A primitive of $(1)$ is$$\begin{array}{rccc}h\colon&\Bbb R&\longrightarrow&\Bbb R\\&x&\mapsto&\begin{cases}\arctan\left(x-\frac1x\right)+\frac\pi2&\text{ if }x>0\\0&\text{ if }x=0\\\arctan\left(x-\frac1x\right)-\frac\pi2&\text{ if }x<0.\end{cases}\end{array}$$You can see its graph below:

enter image description here

  • Can we get a better solution that is defined everywhere $(-\infty, +\infty)$? – Dan Li Aug 18 '21 at 15:46
  • 2
    My function $h$ is defined everywhere. – José Carlos Santos Aug 18 '21 at 15:47
  • Can we get a better solution that is continuous in $(-\infty,+\infty)$? – Dan Li Aug 18 '21 at 15:53
  • 2
    My $h$ is continuous. Otherwise, it would not be differentiable, right?! – José Carlos Santos Aug 18 '21 at 15:57
  • When calculating the definitive integral, I get this function: $$\int_{-\infty}^{x}\frac{x^2+1}{x^4-x^2+1}dx=\begin{cases} \arctan(x-\frac{1}{x})+\frac{\pi}{2}, & \text{if } x<0 \ \pi, & \text{if } x=0 \ \arctan(x-\frac{1}{x})+\frac{3\pi}{2}, & \text{if } x>0 \end{cases}$$, is it aother primitive of your function (1)? – Dan Li Aug 19 '21 at 14:24
  • 1
    Sure, since it differs from $h$ by a constant. – José Carlos Santos Aug 19 '21 at 14:35
  • Since $$\arctan(x)=\frac{i}{2}\ln(1-ix)-\frac{i}{2}\ln(1+ix)$$, then another solution is $$\arctan(x-\frac{1}{x})+C=\frac{i}{2}\ln(1-i(x-\frac{1}{x}))-\frac{i}{2}\ln(1+i(x-\frac{1}{x}))+C$$, what is the primitive of this function? – Dan Li Aug 20 '21 at 18:29
  • 1
    That is not another solution; it's another way of expressing the function $\arctan\left(x-\frac1x\right)$. And therefore the function $h$ is also a primitive of it. Anyway, it seems that you don't think that my answer has answered your question. Therefore, I don't see the point of these comments. – José Carlos Santos Aug 20 '21 at 18:36
  • Your answer is the best. Sorry I just want to learn more about primitive. Thanks a lot. – Dan Li Aug 20 '21 at 18:40
3

Both are. Remember that antiderivatives may differ by a constant (hence the $+ C$).

jjagmath
  • 18,214