<s>[INST] Checking a solution to an indefinite integral I recently did some work to try to find $\int{\frac{dx}{Ax^3 - B}}$, but I'm always paranoid that my solution has some minor trivial error in the middle of the process that screwed up the end result entirely, so could someone please help check my solution?
The first step to my solution is to eliminate $A$ and $B$ from the integrand by pushing them out as constants and leaving $\frac{dx}{x^3 - 1}$. We start with
$$
\begin{align}
\int{\frac{dx}{Ax^3 - B}} & = \int{\frac{dx}{A(x^3 - B/A)}} \\
& = \frac{1}{A}\int{\frac{dx}{x^3 - B/A}}.
\end{align}
$$
To get rid of the $B/A$ term, we make the substitution $x = \sqrt[3]{B/A}u, \ dx = \sqrt[3]{B/A}du$.
$$
\begin{align}
\frac{1}{A}\int\frac{dx}{x^3 - B/A} & = \frac{1}{A}\int{\frac{\sqrt[3]{B/A}du}{(B/A)u^3 - B/A}} \\
& = \frac{1}{A}\cdot\frac{\sqrt[3]{B/A}}{B/A}\int{\frac{du}{u^3 - 1}} \\
& = \mathcal{C}\int{\frac{du}{u^3 - 1}}
\end{align}
$$
with $\mathcal{C} = (AB^2)^{-1/3}$. Now we can just worry about solving $\int{\frac{du}{u^3 - 1}}$.
We can decompose $\frac{1}{u^3 - 1}$ using the fact that $u^3 - 1 = (u - 1)(u^2 + u + 1)$. So
$$
\begin{align}
\frac{1}{u^3 - 1} & = \frac{1}{(u - 1)(u^2 + u + 1)} \\
& = \frac{P}{u - 1} + \frac{Qu + R}{u^2 + u + 1}
\end{align}
$$
Here $P = 1/3$, but $Q$ and $R$ aren't as trivial to find. $u^2 + u + 1$ has no real roots, so I chose to sub in $u = -\sqrt[3]{-1}$ (it was the first root that I found). We then have to solve the equation
$$
(-\sqrt[3]{-1}-1)^{-1} = Q(-\sqrt[3]{-1}) + R
$$
which we can solve by setting $Q = R = [(-1)^{2/3} - 1]^{-1}$ (which will also help when integrating $\frac{Qu + R}{u^2 + u + 1}$ since we can factor $Q$ and $R$ out as a common constant from the numerator).
So
\begin{align}
\mathcal{C}\int{\frac{du}{u^3 - 1}} & = \mathcal{C}\left[\frac{1}{3}\int{\frac{du}{u - 1}} + Q\int{\frac{u + 1}{u^2 + u + 1}du}\right] \\
& = \mathcal{C}\left\{\frac{1}{3}\ln{|u - 1|} + Q\left[\frac{1}{2}\ln{|u^2 + u + 1|} + \frac{1}{\sqrt{3}}\arctan{\left(\frac{2}{\sqrt{3}}u + \frac{1}{\sqrt{3}}\right)} \right] \right\} \\
& = (AB^2)^{-1/3}\left\{\frac{1}{3}\ln{\left|\frac{x}{\sqrt[3]{B/A}} - 1\right|} + \frac{1}{(-1)^{2/3} - 1}\left[\frac{1}{2}\ln{\left|\left(\frac{x}{\sqrt[3]{B/A}}\right)^2 + \frac{x}{\sqrt[3]{B/A}} + 1\right|} \right. \right. \\
& \hspace{15mm} \left. \left. + \frac{1}{\sqrt{3}}\arctan{\left(\frac{2x}{\sqrt{3}\sqrt[3]{B/A}} + \frac{1}{\sqrt{3}}\right)}\right]\right\} + \text{constant}
\end{align} 
(I know what $\int{\frac{x + 1}{x^2 + x + 1}dx}$ is from previous problems)
How does it look? Did I do anything severely wrong (I don't feel entirely confident about the partial fractions part)? Any suggestions for how I could get to an answer faster or more efficiently?
 [/INST] Everything looks fine until your partial fraction decomposition. Indeed $P=\frac{1}{3}$, but to find $Q$ and $R$, start with
$$1 = \frac{1}{3}(u^2+u+1) + (Qu+R)(u-1)$$
and choose  $u=0$ to get
$$1 = \frac{1}{3} - R,$$
so that $R = -\frac{2}{3}$. You then get $Q = -\frac{1}{3}$. So the decomposition is
$$\frac{1}{u^3-1} = \frac{1}{3(u-1)} - \frac{u+2}{3(u^2+u+1)}.$$
(Your solution involves complex numbers --- $(-1)^{2/3}$ is ambiguous, but must be complex since otherwise the denominator vanishes --- I doubt that was what you were looking for.)
</s>