Function Repository Resource:

SumRule

Source Notebook

See how to apply the sum rule for derivatives

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["SumRule"][f,x]

applies the sum rule for computing the derivative of f with respect to x, returning an inactive result.

Details

The sum rule for derivatives states that the derivative of a sum of terms is equal to the sum of the derivatives of each term.
SumRule accepts the following options:
"PrintRule"Falseprint a statement of the sum rule and the derivative rules relevant to each term of the given sum
"PrintNapkin"Falseprint the side "napkin" work needed for computing components of the sum rule
“InactiveInnerDerivatives"Falsekeep the derivatives of the components inactivated

Examples

Basic Examples (1) 

See how to apply the sum rule to compute the derivative of sin(x)+ x2 with respect to x:

In[1]:=
ResourceFunction["SumRule"][Sin[x] + x^2, x]
Out[1]=

Scope (1) 

If there is no explicit sum in the first argument of SumRule, one of the terms is taken to be 0:

In[2]:=
ResourceFunction["SumRule"][Sin[x], x]
Out[2]=

Options (3) 

InactiveInnerDerivatives (1) 

Setting "InactiveInnerDerivatives" to True inactivates the derivatives of the factors within the structure of the sum rule:

In[3]:=
ResourceFunction["SumRule"][Log[x] + Tan[x], x, "InactiveInnerDerivatives" -> True]
Out[3]=

PrintNapkin (1) 

Setting "PrintNapkin" to True prints a grid with the side "napkin" work needed to apply the sum rule (i.e., identifying and computing the derivatives of each term):

In[4]:=
ResourceFunction["SumRule"][x^8 + Exp[4 x], x, "PrintNapkin" -> True]
Out[4]=

PrintRule (1) 

Setting "PrintRule" to True prints a general statement of the sum rule for derivatives along with general statements of the derivative rule needed to compute the derivative of each term:

In[5]:=
ResourceFunction["SumRule"][5 x + 3 x*Log[x] +  Cos[x], x, "PrintRule" -> True]
Out[5]=

Publisher

Wolfram|Alpha Math Team

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 06 June 2023

Related Resources

Author Notes

To view the full source code for SumRule, evaluate the following:

License Information