This exercise comes from Calculus with Analytic Geometry, 5th edition, by Purcell and Varberg, section 8.1, problem 55:

$$\int\frac{x + 1}{9x^2 + 18x + 10}dx$$

The answer key gives $$\frac{1}{18}ln|9x^2 + 18x +10| + C$$ and I understand how they determined it: $$u = 9x^2 + 18x + 10, du = \frac{1}{18}(x + 1)dx, \frac{1}{18}\int\frac{du}{u}$$

However, before looking up the answer, I had taken another route and came up with a different answer, which I am not convinced is incorrect:

$$\int\frac{x + 1}{9x^2 + 18x + 10}dx, \int\frac{x + 1}{9(x + 1)^2 + 1}dx, \int\frac{dx}{9(x + 1) + 1}, \int\frac{dx}{9x + 10}, u = 9x + 10, du = 9dx, \frac{1}{9}\int\frac{du}{u}$$

Y

our second and third expressions above are not equal You can't cancel (x+1) … it's not a factor of the denominator.

This gives $$\frac{1}{9}ln|9x+10| +C$$

Noting the apparent difference between these answers, I wanted to see whether they differed by a constant, which would make them equally valid. I wrote this to determine the difference between these solutions across some domain values:

Code:

import numpy as np
def f(x):
return np.log(np.abs(9*x + 10))/9 - np.log(np.abs(9*x**2 + 18*x + 10))/18
x = np.arange(2000)
a = f(x)

Though the values in `a` seem to converge towards the end of the array, those near the beginning are different enough that I doubt the correctness of my answer. Does anyone see a problem with how I got my solution?