3

I was attempting to solve the integral $$\int \frac{1}{x^4 + 1} \, dx$$ And I came to a stop. What I tried doing was writing it as $$\int \frac{1}{(x^2 + i)(x^2 - i)} \, dx$$ Which can be simplified using partial fractions, resulting in $$\frac{1}{(x^2 + i)(x^2 - i)} = \frac{Ax + B}{x^2 + i} + \frac{Cx + D}{x^2 - i}$$ Which simplifies to $$\frac{1}{(x^2 + i)(x^2 - i)} = \frac{Ax + B}{x^2 + i} + \frac{Cx + D}{x^2 - i}$$

After mutlipliying both sides, you get the result $1 = (Ax + B)(x^2 - i) + (Cx + D)(x^2 + i)$. And after expanding, you get: $$1 = (A + C) x^3 + (B + D) x^2 + (-A i + C i) x + (-B i + D i)$$ However, I tried solving for A, B, C, and D, and I could not get any result, more noticeably, I ran into a problem, as $- B i + D i = 1$, however wouldnt that indicate that that the real part is zero as there are only imaginary terms, in the LHS, yet the RHS has a real part equivalent to 1? I am very confused, and would appreciate any help possible.

Thank you to everyone who responded, especially SemiClassical for helping me realise my mistake. I finished the question and got the result: $$\int \frac{1}{x^4 + 1} \, dx = \frac{1}{2i} \left[ \frac{1}{2\sqrt{i}} \big( \ln(x - \sqrt{i}) - \ln(x + \sqrt{i}) \big) - \frac{1}{2\sqrt{-i}} \big( \ln(x - \sqrt{-i}) - \ln(x + \sqrt{-i}) \big) \right] + C$$

I understand it isn't a standard solution to the problem, but I am pretty sure it is a correct one.

kbyeet
  • 169
  • 5

2 Answers2

6

Let's focus on the first three coefficients in the last equation first. Matching these on both sides of the equality yields $A+C=0,i(C-A)=0,B+D=0$ and hence $A=C=0,B=-D$. Thus the presumptive equality becomes $1=2iD$, and thus we do have a solution $D=1/(2i)$ if we allow $D$ to be imaginary. The amounts to the solution

$$\frac{1}{(x^2+i)(x^2-i)}=\frac{1}{2i}\left[\frac{1}{x^2-i}-\frac{1}{x^2+i}\right]$$

which we can verify directly. Note that (so long as $x^2$ is real) the right-hand side can now be interpreted as the imaginary part of $\frac{1}{x^2-i}$. Hence both sides are manifestly real, despite the presence of imaginary coefficients.

Semiclassical
  • 18,592
  • 1
    Thank you so much, I stupidly didn’t realise that B and D could be complex numbers as well. – kbyeet Jun 25 '25 at 04:56
1

Your algebra is correct up through getting the cubic equation.

$$(A + C)x^3 + (B + D)x^2 + (C - A)ix + (D - B)i - 1 = 0$$

Since the LHS must be zero $\forall x$, all of the coefficients must be zero. So you get the system of equations:

$$A + C = 0 \tag{1}$$ $$B + D = 0 \tag{2}$$ $$C - A = 0 \tag{3}$$ $$(D - B)i - 1 = 0 \tag{4}$$

Note that these are actually two independent systems, (1)&(3) and (2)&(4). The first gives $A=C=0$, and the second gives $B = \frac{i}{2}$ and $D = -\frac{i}{2}$. So:

$$\frac{1}{(x^2 + i)(x^2 - i)} = \frac{i/2}{x^2 + i} - \frac{i/2}{x^2 - i}$$

This is the same as the currently-accepted answer. But one thing I'll add is that you can use also use partial fraction decomposition to break down the integrand into four fractions, each corresponding to a fourth root of $-1$.

$$\frac{i/2}{x^2 + i} = \frac{E}{x - \frac{1-i}{\sqrt{2}}} + \frac{F}{x + \frac{1-i}{\sqrt{2}}} \implies E = \frac{\sqrt{2}(- 1 + i)}{8}, F = \frac{\sqrt{2}(1 - i)}{8}$$ $$- \frac{i/2}{x^2 - i} = \frac{G}{x - \frac{1+i}{\sqrt{2}}} + \frac{H}{x + \frac{1+i}{\sqrt{2}}} \implies G = \frac{\sqrt{2}(-1 - i)}{8}, H = \frac{\sqrt{2}(1 + i)}{8}$$

So, putting this all together,

$$\int \frac{1}{x^4 + 1} ~dx$$ $$= \frac{\sqrt{2}}{8}\int\left(\frac{-1 + i}{x - \frac{1-i}{\sqrt{2}}} + \frac{1 - i}{x + \frac{1-i}{\sqrt{2}}} + \frac{-1 - i}{x - \frac{1+i}{\sqrt{2}}} + \frac{1 + i}{x + \frac{1+i}{\sqrt{2}}}\right) ~dx$$ $$= \frac{\sqrt{2}}{8}\left((-1 + i)\log(x - \frac{1-i}{\sqrt{2}}) + (1 - i)\log(x + \frac{1-i}{\sqrt{2}}) + (-1 - i)\log(x + \frac{1-i}{\sqrt{2}}) + (1 + i)\log(x + \frac{1+i}{\sqrt{2}}) \right) + C$$ $$= \frac{\sqrt{2}}{8}\left((1 - i)\log\left(\frac{x + \frac{1-i}{\sqrt{2}}}{x - \frac{1-i}{\sqrt{2}}}\right) + (1 + i)\log\left(\frac{x + \frac{1+i}{\sqrt{2}}}{x + \frac{1-i}{\sqrt{2}}}\right) \right) + C$$ $$= \frac{\sqrt{2}}{8}\left((1 - i)\log\left(\frac{\sqrt{2}x + 1 - i}{\sqrt{2}x - 1 + i}\right) + (1 + i)\log\left(\frac{\sqrt{2}x + 1 + i}{\sqrt{2}x + 1 - i}\right) \right) + C$$ $$= \frac{\sqrt{2}}{8}\log\left(\frac{(\sqrt{2}x + 1 - i)(\sqrt{2}x + 1 + i)}{(\sqrt{2}x - 1 + i)(\sqrt{2}x + 1 - i)}\right) + \frac{i\sqrt{2}}{8}\log\left(\frac{(\sqrt{2}x + 1 + i)(\sqrt{2}x - 1 + i)}{(\sqrt{2}x + 1 - i)(\sqrt{2}x + 1 - i)}\right) + C$$ $$= \frac{\sqrt{2}}{8}\log\left(\frac{x^2 + \sqrt{2}x + 1}{x^2 + i}\right) + \frac{i\sqrt{2}}{8}\log\left(\frac{x^2 + \sqrt{2}ix - 1}{x^2 + \sqrt{2}x - \sqrt{2}ix - i}\right) + C$$

The second log expression can be written in terms of inverse trig functions, but it's, well, complex.

Dan
  • 18,262