How do you differentiate f(x)=(-e^x+tanx)(x^2-2x) using the product rule?

Mar 8, 2018

The answer is $= {e}^{x} \left(2 - {x}^{2}\right) + \left(x\right) \left(x - 2\right) {\sec}^{2} x + 2 \left(x - 1\right) \tan x$

Explanation:

We need

$\left({e}^{x}\right) ' = {e}^{x}$

$\left(\tan x\right) ' = {\sec}^{2} x$

The product rule is

$\left(u v\right) ' = u ' v + u v '$

Here,

$u = - {e}^{x} + \tan x$, $\implies$, $u ' = - {e}^{x} + {\sec}^{2} x$

$v = {x}^{2} - 2 x$, $\implies$, $v ' = 2 x - 2$

Therefore,

$f ' \left(x\right) = \left(- {e}^{x} + {\sec}^{2} x\right) \left({x}^{2} - 2 x\right) + \left(- {e}^{x} + \tan x\right) \left(2 x - 2\right)$

$= - {x}^{2} {e}^{x} + 2 x {e}^{x} + {x}^{2} {\sec}^{2} x - 2 x {\sec}^{2} x - 2 x {e}^{x} + 2 {e}^{x} + 2 x \tan x - 2 \tan x$

$= {e}^{x} \left(2 - {x}^{2}\right) + \left(x\right) \left(x - 2\right) {\sec}^{2} x + 2 \left(x - 1\right) \tan x$

Mar 8, 2018

${e}^{x} \left(2 - {x}^{2}\right) + 2 \tan x \left(x - 1\right) + x \left(x + 2\right) {\sec}^{2} x$

Explanation:

We know that,
$y = u \cdot v ,$ then, $\frac{\mathrm{dy}}{\mathrm{dx}} = u \cdot \frac{\mathrm{dv}}{\mathrm{dx}} + v \cdot \frac{\mathrm{du}}{\mathrm{dx}}$
Taking, $u = - {e}^{x} + \tan x \mathmr{and} v = {x}^{2} - 2 x$we get
$\frac{\mathrm{du}}{\mathrm{dx}} = - {e}^{x} + {\sec}^{2} x \mathmr{and} \frac{\mathrm{dv}}{\mathrm{dx}} = 2 x - 2$
$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} = \left(- {e}^{x} + \tan x\right) \left(2 x - 2\right) + \left({x}^{2} - 2 x\right) \left(- {e}^{x} + {\sec}^{2} x\right)$
$= \cancel{- 2 x {e}^{x}} + 2 {e}^{x} + 2 x \tan x - 2 \tan x - {x}^{2} {e}^{x} + {x}^{2} {\sec}^{2} x + \cancel{2 x {e}^{x}} + 2 x {\sec}^{2} x$
$= {e}^{x} \left(2 - {x}^{2}\right) + 2 \left(x - 1\right) \tan x + x \left(x + 2\right) {\sec}^{2} x$