Since f is a product of two functions, then we will assume:

u = (x^2+x-1) ===> u'=2x+1

v= x+2 ====> v'=1

Then we have: f = u/v

==> f' = (u'v -uv')/v^2

= (2x+1)(x+2)-(x^2+x-1)(1)/ (x+2)^2

= (2x^2+5x+2)-(x^2+x-1)/(x+2)^2

= (x^2+4x+3)/(x+2)(x+2)

= (x+3)(x+1)/(x+2)(x+2)

We notice that f(x) is a ratio and to find the derivative of f(x), we'll apply the quotient law.

We'll note the 2 functions, which represent the numerator and denominator of the ratio, with:

N-numerator=x^2+x-1

D-denominator=x+2

The quotient law:

f'(x) = [(x^2+x-1)/(x+2)] = [(N)/(D)] = (N'*D-N*D')/D^2

N'=(x^2+x-1)'=2x+1

D'=(x+2)'=1

f'(x) = [(2x+1)(x+2)-(x^2+x-1)]/(x+2)^2

f'(x) = (2x^2+2x+2-x^2-x+1)/(x+2)^2

**f'(x) = (x^2+x+3)/(x+2)^2**

To find the derivative of (x^2+x-1)/(x+2)

Solution:

We know that u(x)/v(x) = { u'(x)v(x) - u(x) v'(x)}/[v(x)]^2.

Therefore { (x^2+x-1)/(x+2)}' = [(x^2+x-1)'(x+2)-(x^2+x-1)(x+2)']/(x+2)^2

=[(2x+1)(x+2)- (x^2+x-1)]/(x+2)^2

={2x^2+5x+2-x^2-x+1}/(x+2)^2

= (x^2+4x+3)/(x+2)^2