Is there a way to find derivative of following function without using product or quotient rule:

$$h(x) = \frac{e^{-x}\cos^2(x)}{x^2 + x + 1}$$

I know how to solve it using product rule and quotient rule, but I'm not sure how to do it without.

I thought about replacing $\cos^2(x)$ with the identity $1 - \sin^2(x)$ but I'm not sure that'll help.

  • 2
    $\begingroup$ Welcome to stackexchange. Short answer: no. Longer answer: in principle you could write down the definition of the derivative for this particular function and work out the limit. You really don't want to go there. Why do you need an answer to this question? $\endgroup$ Commented Nov 4, 2019 at 18:15
  • $\begingroup$ My teacher says there is a way, but I can't see how to solve it without just using product and quotient rule. $\endgroup$ Commented Nov 4, 2019 at 18:18
  • $\begingroup$ You could use the chain and product rule: that true in general. Since $\frac{f}{g} = (f)(g)^{-1}$, the product rule and chain rule give you that $(\frac{f}{g})' = (fg^{-1})' = f' g^{-1} + f(-1)g^{-2}g' = \frac{f'}{g} - \frac{fg'}{g^2}$. $\endgroup$ Commented Nov 4, 2019 at 18:18
  • $\begingroup$ "My teacher says there is a way"... unfortunately, we can't mind read. Exactly what your teacher has in mind is difficult to ascertain, and more so when filtered through your understanding of what they said, and our understanding of what you are saying... $\endgroup$ Commented Nov 4, 2019 at 18:20
  • $\begingroup$ I know how to brute-force it using product rule and quotient rule but I was curious to see if there was an easier way. $\endgroup$ Commented Nov 4, 2019 at 18:25

2 Answers 2


Logarithmic differentiation: \begin{align*} h(x) &= \frac{e^{-x}\cos^2(x)}{x^2 + x + 1}\\ \ln(h(x))&=\ln(e^{-x})+\ln(\cos^2(x))-\ln(x^2+x+1)\\ &=-x+\ln(\cos^2(x))-\ln(x^2+x+1)\\ \frac{h'(x)}{h(x)}&=-1+\frac{-2\cos(x)\sin(x)}{\cos^2(x)}-\frac{2x+1}{x^2+x+1}, \end{align*} solve for $h'$, and plug in what $h$ is, and simplify. Can you finish?


With automatic differentiation:

Lets introduce the dual numbers: The dual numbers is an extend the real numbers by adjoining one new element $\epsilon$ with the property $\epsilon^2 = 0$ ($\epsilon$ is nilpotent). Hence the multiplication of dual numbers is given by: $$ (a + \epsilon b) \cdot (c + \epsilon d) = ac + \epsilon (bc + ad) + \epsilon^2 bd = ac + \epsilon (bc + ad)$$ Taylor expansion with dual numbers give the formula : $h(x+b\epsilon) = h(x) + bϵ\cdot h'(x)$. So we can evaluate this expression and then identify $h'(x)$.

So we have $h(x) = \frac{e^{-x} \cos^{2}{x}}{x^2 + x + 1}$. Lets evaluate $h(x+b\epsilon)$.

$$ h\left(x + bϵ \right)= \frac{e^{-x-bϵ}cos\left(x+bϵ\right)^2}{\left(x+bϵ\right)^2+\left(x+bϵ\right)+1} $$ Using $cos(X)^2 = \frac{cos(2X)+1}{2}$ and developing. $$ h\left(x + bϵ \right)= \frac{1}{\left(x^2+x+1\right)+bϵ\left(2x+1\right)}\cdot e^{-x}e^{-bϵ}\cdot \left[\frac{cos\left(2x+2bϵ\right)+1}{2}\right]$$ Using $cos(a+b)=cos(a)cos(b)-sin(a)sin(b)$ $$ h\left(x + bϵ \right)= \frac{1}{\left(x^2+x+1\right)+bϵ\left(2x+1\right)}\cdot \frac{\:e^{-x}e^{-bϵ}}{2}\cdot \:\left[cos\left(2x\right)cos\left(2bϵ\right)-sin\left(2x\right)sin\left(2bϵ\right)+1\right]$$ Lets take b a small value such that we can use Tailor: $e^{-bϵ} = 1 - bϵ$; $cos(2bϵ) = 1$ and $sin(2bϵ) = 2bϵ$ $$ h\left(x + bϵ \right)= \frac{1}{\left(x^2+x+1\right)+bϵ\left(2x+1\right)}\cdot \:\frac{\:e^{-x}}{2}\cdot \left[1-bϵ\right]\cdot \left[cos\left(2x\right)-2bϵ\cdot sin\left(2x\right)+1\right] $$ Let's develop the expression $$ h\left(x + bϵ \right)= \frac{1}{\left(x^2+x+1\right)+bϵ\left(2x+1\right)}\cdot \:\:\frac{\:e^{-x}}{2}\cdot \:\left[\left(cos\left(2x\right)+1\right)+bϵ\left(-2sin\left(2x\right)-cos\left(2x\right)-1\right)\right]$$ Get rid of the denominator with multiplication by the conjugate: $(a+ϵb)\cdot (a-ϵb) = a^2 - (ϵb)^2 = a^2$ $$ h\left(x + bϵ \right)= \frac{1}{\left(x^2+x+1\right)^2}\cdot \:\:\:\frac{\:e^{-x}}{2}\cdot \:\:\left[\left(cos\left(2x\right)+1\right)+bϵ\left(-2sin\left(2x\right)-cos\left(2x\right)-1\right)\right]\cdot \left[\left(x^2+x+1\right)-bϵ\left(2x+1\right)\right] $$ Expand $$ h\left(x + bϵ \right)= \frac{1}{\left(x^2+x+1\right)^2}\cdot \:\:\:\frac{\:e^{-x}}{2}\cdot \:\: \big[ \left(cos\left(2x\right)+1\right)\cdot \left(x^2+x+1\right)+bϵ\left(-2sin\left(2x\right)-cos\left(2x\right)-1\right)\cdot \left(x^2+x+1\right)+bϵ\left(-2x-1\right)\cdot \left(cos\left(2x\right)+1\right) \big] $$ Using Trigonometry formula: $cos(2x)+1 = 2cos(x)^2$ and $2sin(2x)+cos(2x)+1= 4sin(x)cos(x) + 2cos(x)^2 = 2cos(x)*(2sin(x)+1)$ $$ h\left(x + bϵ \right)= \frac{e^{-x}cos\left(x\right)^2}{x^2+x+1} + \frac{1}{\left(x^2+x+1\right)^2}\cdot \frac{-e^{-x}}{2}\cdot bϵ \cdot \bigg[ \left(2cos\left(x\right)\right)\cdot \left(2sin\left(x\right)+cos\left(x\right)\right)\cdot \left(x^2+x+1\right)+\left(2x+1\right)\left(2cos\left(x\right)^2\right) \bigg] $$ Simplify $$ h\left(x + bϵ \right)= \frac{e^{-x}cos\left(x\right)^2}{x^2+x+1} + bϵ \cdot \bigg[ \frac{-e^{-x}cos\left(x\right)\cdot \left(cos\left(x\right)+2sin\left(x\right)\right)}{x^2+x+1}+\frac{-e^{-x}cos\left(x\right)\left(2x+1\right)}{\left(x^2+x+1\right)^2} \bigg] $$ $$ h\left(x + bϵ \right)= h(x) + bϵ \cdot h'(x) $$

So $h'(x) = \frac{-e^{-x}cos\left(x\right)\cdot \left(cos\left(x\right)+2sin\left(x\right)\right)}{x^2+x+1}+\frac{-e^{-x}cos\left(x\right)\left(2x+1\right)}{\left(x^2+x+1\right)^2} $


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .