Differentiate:

a. y = (x + 3)(x^2 −5x +1)

b. y = x^2e^x

To differentiate the given functions, we can use the power rule and the product rule.

a. y = (x + 3)(x^2 - 5x + 1)

To differentiate this function, we will use the product rule, which states that if we have two functions multiplied together, say u(x) and v(x), then the derivative of the product is given by the formula:

(dy/dx) = u(x)(dv/dx) + v(x)(du/dx)

In this case, u(x) = (x + 3) and v(x) = (x^2 - 5x + 1).

Now, let's find the derivative of each part:

du/dx = 1 (derivative of (x + 3) with respect to x)

dv/dx = 2x - 5 (derivative of (x^2 - 5x + 1) with respect to x)

Using the product rule, we can find the derivative of y:

(dy/dx) = (x + 3)(2x - 5) + (x^2 - 5x + 1)(1)

To simplify, we expand and combine like terms:

(dy/dx) = 2x^2 - 5x + 6x - 15 + x^2 - 5x + 1

(dy/dx) = 3x^2 - 4x - 14

Therefore, the derivative of y = (x + 3)(x^2 - 5x + 1) is dy/dx = 3x^2 - 4x - 14.

b. y = x^2e^x

To differentiate this function, we will also use the product rule, with u(x) = x^2 and v(x) = e^x.

Now, let's find the derivative of each part:

du/dx = 2x (derivative of x^2 with respect to x)

dv/dx = e^x (derivative of e^x with respect to x)

Using the product rule, we can find the derivative of y:

(dy/dx) = x^2(e^x) + (2x)(e^x)

To simplify, we combine like terms:

(dy/dx) = e^x(x^2 + 2x)

Therefore, the derivative of y = x^2e^x is dy/dx = e^x(x^2 + 2x).

By applying the appropriate rules, we have found the derivatives of both given functions.