the expression in the denominator can be factorised to give the denominator of each partial fraction.
x^2+5x+4 = (x+4)(x+1)
the denominators of the partial fractions are (x+4) and (x+1).
the numerators are unknown; therefore, it is easiest to label them as two variables (e.g. a and b).
if this is done, then the partial fractions are (a)/(x+4) and (b)/(x+1).
(a)/(x+4) + (b)/(x+1) = (3x+18)/(x^2+5x+4)
to get rid of the denominator of all of the fractions, you can multiply them by (x^2+5x+4), or (x+4)(x+1).
(a)/(x+4) * (x^2+5x+4) = a(x+1)
(b)/(x+1) * (x^2+5x+4) = b(x+4)
(3x+18)/(x^2+5x+4) * (x^2+5x+4) = 3x+18
since (a)/(x+4) + (b)/(x+1) = (3x+18)/(x^2+5x+4),
a(x+1) + b(x+4) = 3x+18.
multiplying brackets out gives
ax + a + bx + 4b = 3x + 18
then you can group the x terms and the constant terms:
ax + bx + a + 4b = 3x + 18
(a+b)x + a + 4b = 3x + 18
for both sides to be equal, the coefficients of x and the coefficients of 1 must be equal to each other.
(a+b)x = 3x
a + 4b = 18
a + b = 3
a + 4b = 18
b can be solved for:
a + 4b = a + b + 15
4b = b + 15
3b = 15
b = 5
and so can a:
a + b = 3
a + 5 = 3
a = 3 - 5
a = -2
these values for a and b can be substituted into the numerators of the partial fractions (a)/(x+4) and (b)/(x+1),
giving -2/(x+4) and 5/(x+1)
to check:
-2/(x+4) + 5/(x+1) = (-2(x+1))/(x^2+5x+4) + (5(x+4))/(x^2+5x+4)
= ((-2x - 2) + (5x + 20)) / (x^2+5x+4)
= (3x+18)/(x^2+5x+4)