Use integration by partial fractions.
#A/(x + 1) + B/(x- 4) = (x - 2)/((x + 1)(x - 4))#
#A(x - 4) + B(x + 1) = x- 2#
#Ax - 4A + Bx + B = x - 2#
#(A + B)x + (B - 4A) = x - 2#
We can hence write the following system of equations.
#{(A + B = 1), (B - 4A = -2):}#
Solve:
#B = 1-A#
#1 - A - 4A = -2#
#-5A = -3#
#A = 3/5#
#A + B = 1#
#3/5 + B = 1#
#B = 2/5#
Hence, the partial fraction decomposition is #3/(5(x + 1)) + 2/(5(x - 4))#. We integrate using the rule #int(1/x)dx = ln|x| + C#.
#=>3/5ln|x + 1| + 2/5ln|x - 4| + C#
The function is #y= 3/5ln|x + 1| + 2/5ln|x - 4| + C#. We know an input/output of the function, so in this case we will solve for #C# to find the specific function.
We have that when #x =2#, #y = 5#.
#5 = 3/5ln|2 + 1| + 2/5ln|2 - 4| + C#
#5 = 3/5ln3 + 2/5ln2 + C#
#C = 5 - 3/5ln3 - 2/5ln2#
#C~=4.06#
#:.#The final function is #y = 3/5ln|x + 1| + 2/5ln|x - 4| + 4.06#, nearly.
Hopefully this helps!