Evaluate integral as a logarithm plus an arctangent. Evaluate the integral as a logarithm plus an arctangent.
$$ \int \frac{x}{3x^2-18x+45} \ dx $$
I just completed the square and couldn't continue.
$$ \int \frac{x}{3(x-3)^2+18} \ dx $$
Fixed a typo $18$ changed to $18 x$

Write the numerator as $x-3+3$ to get
$$
\int \frac{x-3}{3 (x-3)^2 + 18}dx + \int \frac{3}{3 (x-3)^2 + 18} dx$$
This gives
$${{\log \left(3\,\left(x-3\right)^2+18\right)}\over{6}}+{{\arctan \left({{x-3}\over{\sqrt{6}}}\right)}\over{\sqrt{6}}}$$
Here are the details.
In the first integral let $(x-3)^2 = u$. Then $2 (x-3) dx = du$ and hence
$$
\int \frac{x-3}{3 (x-3)^2 + 18}dx  = \frac{1}{2} \int \frac{du}{3 u + 1}$$
If you do not see the integral right-away, make the second substitution $v=3 u +1$ to get
$dv = 3 du$ and
$$\int \frac 12\frac{du}{3 u + 1} =\frac 12 \frac{1}{3} \int \frac{dv}{v} = \frac{1}{6}\log(v)$$
To get the second integral
$$
\int \frac{3}{3 (x-3)^2 + 18} dx =\int \frac{1}{ (x-3)^2 + 6} dx  =
\frac{1}{6} \frac{1}{ (\frac{x-3}{\sqrt{6}})^2 + 1} dx $$
Now make the substitution
$$
\frac{x-3}{\sqrt{6}} = v$$
and use $dx = \sqrt{6} dv$ to ge the second integral as
$$
\frac{1}{\sqrt{6}} \int \frac{dv}{v^2+1} = \frac{1}{\sqrt{6}} \arctan(v)
$$
