Tutorials › Calculus III › Partial Derivatives of Trigonometric Products

Computing Partial Derivatives · Tutorial 309 of 999

Partial Derivatives of Trigonometric Products

Use the product rule and basic trigonometric derivatives to find first partial derivatives of products involving one or more variables.

Beginner 9 min read

What You'll Learn

  • Identify which trigonometric factors vary with the chosen differentiation variable.
  • Apply the partial product rule to products of sine and cosine factors.
  • Use the chain rule for trigonometric factors such as sine of a constant multiple of a variable.
  • Compute both first partial derivatives of a two-variable trigonometric product.
  • Recognize and correct errors caused by differentiating with respect to the wrong variable.

Why trigonometric products need careful partial differentiation

A product such as \(\sin x\cos y\) changes when either \(x\) or \(y\) changes. A partial derivative measures change with respect to just one variable at a time: when differentiating with respect to \(x\), hold \(y\) fixed; when differentiating with respect to \(y\), hold \(x\) fixed.

This matters because a trigonometric factor may be constant with respect to the variable being used, even though it is not a constant number overall. For example, \(\cos y\) stays fixed during differentiation with respect to \(x\), while \(\sin x\) stays fixed during differentiation with respect to \(y\). The product rule then combines the changing factors correctly.

Definition: For a function \(f(x,y)\), the partial derivative \(f_x(x,y)\) is the derivative with respect to \(x\) while \(y\) is held fixed. The partial derivative \(f_y(x,y)\) is the derivative with respect to \(y\) while \(x\) is held fixed.

The trigonometric derivatives and product rule

The basic single-variable derivatives used here are \(\frac{d}{du}\sin u=\cos u\) and \(\frac{d}{du}\cos u=-\sin u\). If the angle is a constant multiple of the variable, the chain rule supplies that multiple: for a constant \(a\), the derivatives of \(\sin(ax)\) and \(\cos(ax)\) with respect to \(x\) are \(a\cos(ax)\) and \(-a\sin(ax)\), respectively.

For differentiable functions \(u\) and \(v\), the product rule is \((uv)'=u'v+uv'\). For a partial derivative, apply this rule to the chosen variable, differentiating each factor with respect to that variable. Factors that depend only on the other variable have derivative zero and are held as factors in the expression.

Rule: If \(f(x,y)=u(x,y)v(x,y)\), and both factors have partial derivatives with respect to the variable in question, then \(f_x=u_xv+uv_x\) and \(f_y=u_yv+uv_y\). Each partial derivative acts on its own variable; the other variable is held fixed.

For products made from factors of \(x\) alone and factors of \(y\) alone, it is useful to make the structure explicit. Suppose \(f(x,y)=A_1(x)\cdots A_m(x)B_1(y)\cdots B_n(y)\), where the factors are differentiable. Then differentiating with respect to \(x\) gives

$$ f_x= \left(\prod_{j=1}^{n}B_j(y)\right) \sum_{i=1}^{m} A_i'(x)\prod_{\substack{k=1\\k\ne i}}^{m}A_k(x). $$

For \(f_y\), the corresponding formula differentiates each \(B_j(y)\) once and leaves every \(A_i(x)\) in place. These formulas apply whether the factors are sines, cosines, or other differentiable functions of a single variable. They do not require any factor to be nonzero.

Why the variable-independent factors stay in place

The rule for a product of a function of \(x\) and a function of \(y\) can be seen directly from the difference quotient. Let \(f(x,y)=A(x)B(y)\), where \(A\) and \(B\) are differentiable. In the partial derivative with respect to \(x\), \(y\) is fixed, so \(B(y)\) has the same value at \(x+h\) and at \(x\). Therefore, for \(h\ne 0\),

$$ \frac{f(x+h,y)-f(x,y)}{h} = \frac{A(x+h)B(y)-A(x)B(y)}{h} = B(y)\frac{A(x+h)-A(x)}{h}. $$

Taking the limit as \(h\) approaches zero gives \(f_x(x,y)=A'(x)B(y)\). For the derivative with respect to \(y\), \(A(x)\) stays fixed instead, giving \(f_y(x,y)=A(x)B'(y)\). This explains why a factor depending only on the other variable is carried along unchanged.

When several factors depend on the variable being differentiated, the product rule adds one term for each factor: in each term, differentiate one factor and leave the others unchanged. This is the repeated product rule used in the examples below.

Worked examples

Worked Example: A product of sine and cosine in different variables

Find both first partial derivatives of \(f(x,y)=\sin x\cos y\).

For \(f_x\), treat \(\cos y\) as fixed and differentiate \(\sin x\):

$$ f_x(x,y) = \frac{\partial}{\partial x}(\sin x)\cos y = \cos x\cos y. $$

For \(f_y\), treat \(\sin x\) as fixed and differentiate \(\cos y\):

$$ f_y(x,y) = \sin x\frac{\partial}{\partial y}(\cos y) = \sin x(-\sin y) = -\sin x\sin y. $$

Check: In the \(x\)-derivative only the \(x\)-factor has changed, and in the \(y\)-derivative only the \(y\)-factor has changed. The negative sign in \(f_y\) comes from the derivative of cosine.

Worked Example: Constant multiples inside the angles

Find both first partial derivatives of \(g(x,y)=\sin(2x)\cos(3y)\).

With respect to \(x\), the chain rule gives \(\frac{\partial}{\partial x}\sin(2x)=2\cos(2x)\). The factor \(\cos(3y)\) is fixed, so

$$ g_x(x,y) = 2\cos(2x)\cos(3y). $$

With respect to \(y\), the factor \(\sin(2x)\) is fixed. Differentiating \(\cos(3y)\) gives \(-3\sin(3y)\), so

$$ g_y(x,y) = \sin(2x)\bigl(-3\sin(3y)\bigr) = -3\sin(2x)\sin(3y). $$

Check: The coefficient \(2\) appears because the inner angle \(2x\) has derivative \(2\); the coefficient \(-3\) appears because the inner angle \(3y\) has derivative \(3\), and cosine differentiates to negative sine. No chain-rule coefficient is introduced from the factor held fixed.

Worked Example: A product with two factors depending on the same variable

Find both first partial derivatives of \(h(x,y)=\sin x\cos y\cos(2x)\).

For \(h_x\), both \(\sin x\) and \(\cos(2x)\) depend on \(x\), so the product rule gives two terms. The middle factor \(\cos y\) is fixed:

$$ \begin{aligned} h_x(x,y) &=(\cos x)\cos y\cos(2x) +\sin x\cos y\bigl(-2\sin(2x)\bigr)\\ &=\cos x\cos y\cos(2x) -2\sin x\cos y\sin(2x). \end{aligned} $$

For \(h_y\), the two factors depending on \(x\) are fixed, while \(\cos y\) differentiates to \(-\sin y\):

$$ h_y(x,y) = \sin x(-\sin y)\cos(2x) = -\sin x\sin y\cos(2x). $$

Check: The \(x\)-derivative has one term for each of the two \(x\)-dependent factors. In its second term, \(\frac{\partial}{\partial x}\cos(2x)=-2\sin(2x)\). The \(y\)-derivative has just one product-rule term because only \(\cos y\) depends on \(y\).

Worked Example: A sum inside one factor

Find both first partial derivatives of \(q(x,y)=(\sin x+\cos x)\sin y\).

For \(q_x\), the product rule applies to the displayed factors. The derivative of the first factor is \(\cos x-\sin x\), and \(\sin y\) is fixed:

$$ q_x(x,y) = (\cos x-\sin x)\sin y. $$

For \(q_y\), the first factor is fixed and the derivative of \(\sin y\) is \(\cos y\):

$$ q_y(x,y) = (\sin x+\cos x)\cos y. $$

Check: Differentiating \(\sin x+\cos x\) with respect to \(x\) gives \(\cos x-\sin x\), including the minus sign from the cosine term. Differentiating with respect to \(y\) leaves the entire sum unchanged.

A common mistake: differentiating the wrong factor

When finding \(f_y\) for \(f(x,y)=\sin x\cos y\), a common error is to differentiate both factors as though the variable were \(x\), or to change \(\sin x\) into \(\cos x\) even though the derivative is with respect to \(y\). For example, this calculation is wrong:

$$ \text{Incorrect:}\qquad f_y=\cos x\cos y-\sin x\sin y. $$

The term \(\cos x\cos y\) comes from differentiating \(\sin x\) with respect to \(x\), not with respect to \(y\). For \(f_y\), \(x\) is held fixed, so \(\sin x\) does not change. Only \(\cos y\) is differentiated:

$$ \text{Correct:}\qquad f_y = \underbrace{\frac{\partial}{\partial y}(\sin x)}_{0}\cos y +\sin x\underbrace{\frac{\partial}{\partial y}(\cos y)}_{-\sin y} = -\sin x\sin y. $$

A reliable check before applying the product rule is to identify which factors actually contain the variable being differentiated. Then differentiate only those factors, one at a time, leaving all other factors in each product-rule term.

What to keep in mind

Partial derivatives of trigonometric products use familiar single-variable rules, but the choice of variable determines which factors change. For products of several factors, include every product-rule term for the factors that depend on that variable. Apply the chain rule whenever an angle contains a constant multiple of the variable.

Key takeaway: For each partial derivative, hold the other variable fixed, differentiate the relevant trigonometric factor or factors, and preserve the remaining factors in the product-rule terms.

Check Your Understanding

For each question, state which factors vary with the indicated variable before computing.

  1. Find \(f_x\) and \(f_y\) if \(f(x,y)=\cos x\sin y\).
  2. Find both first partial derivatives of \(g(x,y)=\cos(4x)\sin(2y)\).
  3. Find \(h_x\) if \(h(x,y)=\sin x\sin(3x)\cos y\).
  4. In differentiating \(\sin x\cos y\) with respect to \(y\), why is \(\sin x\) unchanged?
  5. How many product-rule terms appear in the \(x\)-derivative of \(\sin x\cos y\cos(2x)\), and why?