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.
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.
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
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\),
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\):
For \(f_y\), treat \(\sin x\) as fixed and differentiate \(\cos 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
With respect to \(y\), the factor \(\sin(2x)\) is fixed. Differentiating \(\cos(3y)\) gives \(-3\sin(3y)\), so
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:
For \(h_y\), the two factors depending on \(x\) are fixed, while \(\cos y\) differentiates to \(-\sin y\):
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:
For \(q_y\), the first factor is fixed and the derivative of \(\sin y\) is \(\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:
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:
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.
Check Your Understanding
For each question, state which factors vary with the indicated variable before computing.
- Find \(f_x\) and \(f_y\) if \(f(x,y)=\cos x\sin y\).
- Find both first partial derivatives of \(g(x,y)=\cos(4x)\sin(2y)\).
- Find \(h_x\) if \(h(x,y)=\sin x\sin(3x)\cos y\).
- In differentiating \(\sin x\cos y\) with respect to \(y\), why is \(\sin x\) unchanged?
- How many product-rule terms appear in the \(x\)-derivative of \(\sin x\cos y\cos(2x)\), and why?