WOLFRAM

gives a sawtooth wave that varies from 0 to 1 with unit period.

SawtoothWave[{min,max},x]

gives a sawtooth wave that varies from min to max with unit period.

Details

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Evaluate numerically:

Out[1]=1

Plot over a subset of the reals:

Out[1]=1

SawtoothWave is a piecewise function over finite domains:

Out[1]=1

Scope  (34)Survey of the scope of standard use cases

Numerical Evaluation  (6)

Evaluate numerically:

Out[1]=1
Out[2]=2

Numerically evaluate a sawtooth with specified range:

Out[1]=1

Evaluate to high precision:

Out[1]=1

The precision of the output tracks the precision of the input:

Out[2]=2

Evaluate efficiently at high precision:

Out[1]=1
Out[2]=2

SawtoothWave threads over lists in the last argument:

Out[1]=1
Out[2]=2

Compute the elementwise values of an array using automatic threading:

Out[1]=1

Or compute the matrix SawtoothWave function using MatrixFunction:

Out[2]=2

Specific Values  (4)

Value at zero:

Out[1]=1

Values at fixed points:

Out[1]=1

Evaluate symbolically:

Out[1]=1
Out[2]=2

Find a value of x for which SawtoothWave[{2,-3},x]=1 :

Out[1]=1
Out[2]=2

Visualization  (4)

Plot the SawtoothWave function:

Out[1]=1

Visualize scaled SawtoothWave functions:

Out[1]=1

Visualize SawtoothWave functions with different maximum and minimum values:

Out[1]=1

Plot SawtoothWave in three dimensions:

Out[1]=1

Function Properties  (10)

Function domain of SawtoothWave:

Out[1]=1

It is restricted to real inputs:

Out[2]=2

Function range of SawtoothWave[x]:

Out[1]=1

SawtoothWave is periodic with period 1:

Out[1]=1

The area under one period is :

Out[1]=1

SawtoothWave is not an analytic function:

Out[1]=1

It has both singularities and discontinuities at the integers:

Out[2]=2
Out[3]=3

SawtoothWave[x] is neither nondecreasing nor nonincreasing:

Out[1]=1

SawtoothWave is not injective:

Out[1]=1
Out[2]=2

SawtoothWave[x] is not surjective:

Out[1]=1
Out[2]=2

SawtoothWave[x] is non-negative:

Out[1]=1

SawtoothWave is neither convex nor concave:

Out[1]=1

Differentiation and Integration  (5)

First derivative with respect to :

Out[1]=1

Derivative of the two-argument form with respect to :

Out[1]=1

The second (and higher) derivatives are zero except at points where the derivative does not exist:

Out[1]=1

If a==b, SawtoothWave[{a,b},x] is constant and its derivatives are zero everywhere:

Out[1]=1

Integrals over finite domains:

Out[1]=1
Out[2]=2

Series Expansions  (5)

FourierSeries:

Out[1]=1

Since SawtoothWave is odd except for a constant, FourierTrigSeries gives a simpler result:

Out[2]=2

The two results are equivalent:

Out[3]=3

FourierCosSeries of a scaled SawtoothWave:

Out[1]=1

Taylor series at a smooth point:

Out[1]=1

Series expansion at a singular point:

Out[1]=1

Taylor expansion at a generic point:

Out[1]=1

Applications  (2)Sample problems that can be solved with this function

Fourier decomposition of sawtooth wave signal:

Out[1]=1
Out[2]=2
Out[3]=3

Sawtooth wave sound sample:

Out[1]=1

Properties & Relations  (4)Properties of the function, and connections to other functions

Use FunctionExpand to expand SawtoothWave in terms of elementary functions:

Out[1]=1

Use PiecewiseExpand to obtain a piecewise representation over an interval:

Out[1]=1

Integration:

Out[1]=1
Out[2]=2
Out[3]=3

SawtoothWave[x] is lower semicontinuous but not upper semicontinuous at the origin:

Out[1]=1

This differs from TriangleWave[x], which is both upper and lower semicontinuous, and thus continuous:

Out[2]=2

As well as SquareWave[x], which is only upper semicontinuous:

Out[3]=3

Visualize the three functions:

Out[4]=4

Possible Issues  (1)Common pitfalls and unexpected behavior

SawtoothWave is not defined for complex arguments:

Out[1]=1
Wolfram Research (2008), SawtoothWave, Wolfram Language function, https://reference.wolfram.com/language/ref/SawtoothWave.html.
Wolfram Research (2008), SawtoothWave, Wolfram Language function, https://reference.wolfram.com/language/ref/SawtoothWave.html.

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_sawtoothwave, author="Wolfram Research", title="{SawtoothWave}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/SawtoothWave.html}", note=[Accessed: 26-April-2025 ]}

@misc{reference.wolfram_2025_sawtoothwave, author="Wolfram Research", title="{SawtoothWave}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/SawtoothWave.html}", note=[Accessed: 26-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_sawtoothwave, organization={Wolfram Research}, title={SawtoothWave}, year={2008}, url={https://reference.wolfram.com/language/ref/SawtoothWave.html}, note=[Accessed: 26-April-2025 ]}

@online{reference.wolfram_2025_sawtoothwave, organization={Wolfram Research}, title={SawtoothWave}, year={2008}, url={https://reference.wolfram.com/language/ref/SawtoothWave.html}, note=[Accessed: 26-April-2025 ]}