DifferenceQuotient

DifferenceQuotient[f,{x,h}]

gives the difference quotient .

DifferenceQuotient[f,{x,n,h}]

gives a multiple difference quotient with step h.

DifferenceQuotient[f,{x1,n1,h1},{x2,n2,h2},]

computes the partial difference quotient with respect to x1,x2,.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Compute the difference quotient for a function:

Obtain the limit as h approaches 0:

This limit is the derivative of the function:

Scope  (16)

Basic Uses  (4)

Compute a forward difference quotient with step h:

Backward difference quotient:

Symmetric difference quotient:

Compute the second difference quotient with step h:

Third difference quotient:

Partial difference quotient with steps r and s:

DifferenceQuotient threads over lists:

Univariate Difference Quotients  (8)

DifferenceQuotient of a constant is 0:

DifferenceQuotient of a polynomial function is a polynomial function:

Each successive difference quotient will lower the degree in x by one:

Rational functions:

Difference quotients of rational functions will stay as rational functions:

Trigonometric functions:

Exponential functions:

Polynomial exponentials:

Difference quotients of PolyGamma with an integer step are rational functions:

Similarly for HarmonicNumber and Zeta:

FactorialPower with step h has a simple difference quotient for a matching step h:

Multivariate Difference Quotients  (4)

DifferenceQuotient of a multivariate polynomial function is a polynomial function:

Difference quotients of multivariate rational functions will stay as rational functions:

DifferenceQuotient of multivariate functions depending on a subset of the variables are 0:

DifferenceQuotient for a product of univariate functions:

This is equal to the product of the individual difference quotients:

Options  (1)

Assumptions  (1)

Specify assumptions on the variable x and the step h to obtain simpler results:

Applications  (10)

Derivatives from First Principles  (3)

Compute the derivative of a polynomial from first principles:

Compute the derivative using D:

Exponential function:

Trigonometric function:

Compute the second derivative for a power function:

Third derivative for a power tower:

Compute the partial derivative with respect to x for a function of two variables:

Partial derivative with respect to y:

Mixed partial derivative:

Approximate Derivatives  (3)

Approximate the derivative at a point using DifferenceQuotient:

Derivative at x=2.7:

Approximation given by DifferenceQuotient:

Approximate the derivative of a function using various difference quotients:

Exact derivative:

Use forward difference quotients to obtain an approximation:

Backward difference quotients:

Symmetric difference quotients:

Approximate the partial derivatives at a point using DifferenceQuotient:

Differential Equations  (3)

Discretize a differential equation using forward differences:

Solve the differential equation using DSolveValue:

Solve the difference equation using RSolveValue:

Compare the exact and approximate solutions:

Discretize a differential equation using backward differences:

Solve the differential equation using DSolveValue:

Solve the difference equation using RSolveValue:

Compare the exact and approximate solutions:

Discretize a differential equation using symbolic differences:

Solve the differential equation using DSolveValue:

Solve the difference equation using RSolveValue:

Compare the exact and approximate solutions using forward and backward differences:

Obtain the exact solution as a limit of the approximate solution:

Extrapolation  (1)

Richardson extrapolation is a method for sequence acceleration that can be used to improve the rate of convergence of a sequence a[h], which depends on a parameter h. Apply Richardson extrapolation to accelerate the convergence of DifferenceQuotient to the derivative of a function f[x] using the sequence a[x,h], which is defined by:

Set up a scheme for Richardson extrapolation:

Define the function:

Compute the derivative at a point:

Approximation given by DifferenceQuotient:

Richardson extrapolation improves the derivative approximation:

Properties & Relations  (6)

DifferenceQuotient gives the slope of the secant line joining two nearby points on a curve:

The Limit of DifferenceQuotient is the derivative D:

An iterated Limit of a multiple difference quotient gives a mixed partial derivative:

DifferenceQuotient is related to DifferenceDelta as TemplateBox[{{f, (, x, )}, x, 1, h}, DifferenceDelta4]/h:

DifferenceQuotient is related to DiscreteShift as (TemplateBox[{{f, (, x, )}, x, 1, h}, DiscreteShift4]-f(x))/h:

DifferenceQuotient is a linear operator:

Interactive Examples  (1)

The function parametrizes the secant line between and :

Visualize how the secant line changes over the function, but at every point becomes tangent as :

Neat Examples  (1)

Create a table of common difference quotients:

Wolfram Research (2016), DifferenceQuotient, Wolfram Language function, https://reference.wolfram.com/language/ref/DifferenceQuotient.html.

Text

Wolfram Research (2016), DifferenceQuotient, Wolfram Language function, https://reference.wolfram.com/language/ref/DifferenceQuotient.html.

CMS

Wolfram Language. 2016. "DifferenceQuotient." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DifferenceQuotient.html.

APA

Wolfram Language. (2016). DifferenceQuotient. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DifferenceQuotient.html

BibTeX

@misc{reference.wolfram_2024_differencequotient, author="Wolfram Research", title="{DifferenceQuotient}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/DifferenceQuotient.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_differencequotient, organization={Wolfram Research}, title={DifferenceQuotient}, year={2016}, url={https://reference.wolfram.com/language/ref/DifferenceQuotient.html}, note=[Accessed: 22-December-2024 ]}