First off, you should have gotten
$$\frac{x^3+2}{(x-1)^2}=x+2+\frac{\color{Red}{3}x}{(x-1)^2}.$$
How did you get this anyway? Did you have a process? There is a process for breaking down rational functions into summands of a certain type. You've done some of the work, but you need to go further because this is not the finished partial fraction expansion.
Secondly, the antiderivative of $(x-1)^{-2}$ is $\color{Red}{-}(x-1)^{-1}$.
Given any polynomial $f(x)$ and any complex number $a\in\Bbb C$ we can write $f$ as a polynomial in the variable $x-a$, that is $f(x)=g(x-a)$ for some polynomial $g$. Essentially, this changes the "base" of the polynomial from $x$ to $x-a$, much like we can convert a number from base $10$ to base $2$.
Now, if we start with a rational function $f(x)/(x-a)^n$ (with $\deg f<n$) we may write $f$ as a polynomial in the base $x-a$ as $g(x-a)=c_0+c_1(x-a)+\cdots+c_d(x-a)^d$ and so
$$\frac{f(x)}{(x-a)^n}=\frac{c_0}{(x-a)^n}+\frac{c_1}{(x-a)^{n-1}}+\cdots+\frac{c_d}{(x-a)^{n-d}}.$$
There are two things that can make the situation more complicated: (1) if you're not working over the complex numbers $\Bbb C$, there are going to be irreducible polynomials that are not linear - of the form $x-a$ for some scalar - and then (2) if the rational function you begin with has multiple different irreducible factors present in the full factorization of its denominator.
Let's talk about partial fraction decomposition over the complex numbers. Say we have $f(x)/g(x)$. Without loss of generality we may assume that $\deg f<\deg g$, since otherwise we can invoke polynomial long division. Factor $g(x)=(x-u_1)^{e_1}\cdots(x-u_d)^{e_d}$. Since we know we can expand
$$\frac{1}{(x-u)(x-v)}=\frac{1}{u-v}\left[\frac{1}{x-u}-\frac{1}{x-v}\right],$$
we could use this inductively until we eventually will obtain an expansion of the form
$$a_1(x)/(x-u_1)^{e_1}+\cdots+a_d(x)/(x-u_d)^{e_d}$$
for some numerators $a_i(x)$. But note that $a_i(x)=b_i(x-u_i)$ for some polynomials $b_i$, so ultimately we should be able to write
$$\begin{array}{rl} \displaystyle\frac{f(x)}{g(x)} = & \displaystyle \frac{a_{1,1}}{x-u_1}+\frac{a_{1,2}}{(x-u_1)^2}+\cdots+\frac{a_{1,e_1}}{(x-u_1)^{e_1}}+\cdots\cdots \\ + & \displaystyle \frac{a_{d,1}}{x-u_d}+\frac{a_{d,2}}{(x-u_d)^2}+\cdots+\frac{a_{d,e_d}}{(x-u_d)^{e_d}} \end{array}$$
A priori one might believe we should also have a polynomial in $x$ in front of the expansion on the right, but this isn't possible because we know that $\deg f<\deg g$.
To find the coefficient of $(x-u_i)^{-k}$ (where $k\le e_i$) you can multiply the above equation by $(x-u_i)^{e_i}$, take the derivative $e_i-k$ times, evaluate at $x=u_i$. Another method is to add all of the terms above using the unknowns, equate numerators and then solve for the unknowns (as they will exist in a linear system of equations).
Here is the general spiel on how and why pfd works. Suppose we have a rational function of the form $f(x)/g(x)$ with $\deg f<\deg g$. Factor $g(x)=\pi_1(x)^{e_1}\cdots\pi_d(x)^{e_d}$. If we want to expand $f/g$ into the "initial" expansion $a_1(x)/\pi_1(x)^{e_1}+\cdots+a_d(x)/\pi_d(x)^{e_d}$ it suffices to be able to do it to $1/g(x)$, since once we do that we can multiply each $a_i(x)$ by $f(x)$.
To compute $a_i(x)$, set $f/g$ equal to this expansion, multiply both sides by $g(x)$, and then reduce "modulo $\pi_i(x)$" to obtain $f(x)\equiv a_i(x)\prod_{j\ne i}\pi_j(x)^{e_j}$ mod $\pi_i(x)$, which can be solved for in $a_i(x)$ since the other irreducible factors are all distinct from $\pi_i(x)$ and hence invertible mod $\pi_i(x)$. It might sound crazy at first that we can reduce polynomials "modulo" other polynomials, just like we do with numbers, but this is indeed possible because we still have Euclidean division.
Anyway, now we know an "initial" expansion of $f/g$ exists, to get the full partial fraction expansion we need to know how to decompose the rational functions of the form $a(x)/\pi(x)^e$ where $\pi$ is irreducible. We can't simply use the same "translation" thing as earlier. What we can do is use the Euclidean division property I just mentioned: write $a(x)=q_0(x)\pi(x)+r_0(x)$, where $q$ is the quotient and $r$ is the remainder (with $\deg r<\deg \pi$). One can continue this process on the $q_i$s, obtaining $a(x)=(q_1(x)\pi(x)+r_1(x))\pi(x)+r_0(x)$, etc. until finally we stop at the "expansion in base $\pi$" given by $a(x)=r_k(x)\pi(x)^k+\cdots+r_1(x)\pi_1(x)+r_0(x)$. Thus,
$$\frac{a(x)}{\pi(x)^e}=\frac{r_k(x)}{\pi(x)^{e-k}}+\cdots+\frac{r_0(x)}{\pi(x)^e}.$$