SawtoothWave[x]
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.
SawtoothWave
SawtoothWave[x]
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
- SawtoothWave[0] is 0.
- SawtoothWave automatically threads over lists. »
Examples
open all close allBasic Examples (3)
SawtoothWave[0.2]Plot over a subset of the reals:
Plot[SawtoothWave[x], {x, -2, 2}]SawtoothWave is a piecewise function over finite domains:
PiecewiseExpand[SawtoothWave[x], -1 ≤ x ≤ 1]Scope (34)
Numerical Evaluation (6)
SawtoothWave[-1]SawtoothWave[1 / 4]Numerically evaluate a sawtooth with specified range:
SawtoothWave[{0, 2}, 1.6]N[SawtoothWave[-1 / 47], 50]The precision of the output tracks the precision of the input:
SawtoothWave[-1.4444444444444444444447]Evaluate efficiently at high precision:
SawtoothWave[5 / 7`100]//TimingSawtoothWave[11 / 977`100000000];//TimingSawtoothWave threads over lists in the last argument:
SawtoothWave[{0.4, 1.2, 3.6}]SawtoothWave[{0, 5}, {0.4, 1.2, 3.6}]Compute the elementwise values of an array using automatic threading:
SawtoothWave[{{1 / 4, -1}, {0, 1 / 5}}]Or compute the matrix SawtoothWave function using MatrixFunction:
MatrixFunction[SawtoothWave, {{1 / 4, -1}, {0, 1 / 5}}]Specific Values (4)
SawtoothWave[0]Table[SawtoothWave[x], {x, 0, 2, 2 / 3}]FunctionExpand[SawtoothWave[x], x∈Reals]PiecewiseExpand[SawtoothWave[x], -1 < x < 1]Find a value of x for which SawtoothWave[{2,-3},x]=1 :
xval = x /. FindRoot[SawtoothWave[{2, -3}, x] == 1, {x, 0.5}]Plot[SawtoothWave[{2, -3}, x], {x, -1, 2}, Epilog -> Style[Point[{xval, SawtoothWave[{2, -3}, xval]}], PointSize[Large], Red], ExclusionsStyle -> Dotted]Visualization (4)
Plot the SawtoothWave function:
Plot[SawtoothWave[x], {x, -3, 3}, Filling -> Axis]Visualize scaled SawtoothWave functions:
Plot[{SawtoothWave[x], SawtoothWave[x / 2], SawtoothWave[2x]}, {x, 0, 4}, PlotLegends -> "Expressions", PlotTheme -> "DashedLines"]Visualize SawtoothWave functions with different maximum and minimum values:
Plot[{SawtoothWave[x], SawtoothWave[{-1, 1}, x], SawtoothWave[{0, 2}, x]}, {x, -2, 2}, PlotLegends -> "Expressions"]Plot SawtoothWave in three dimensions:
Plot3D[SawtoothWave[x + y], {x, -1, 1}, {y, -1, 1}, ColorFunction -> "SouthwestColors"]Function Properties (10)
Function domain of SawtoothWave:
FunctionDomain[SawtoothWave[{a, b}, x], {x, a, b}]It is restricted to real inputs:
FunctionDomain[SawtoothWave[{a, b}, x], {x, a, b}, Complexes]Function range of SawtoothWave[x]:
FunctionRange[SawtoothWave[x], x, y]SawtoothWave is periodic with period 1:
FunctionPeriod[SawtoothWave[x], x]The area under one period is
:
Integrate[SawtoothWave[x], {x, 0, 1}]SawtoothWave is not an analytic function:
FunctionAnalytic[SawtoothWave[x], x]It has both singularities and discontinuities at the integers:
FunctionSingularities[SawtoothWave[x], x]FunctionDiscontinuities[SawtoothWave[x], x]SawtoothWave[x] is neither nondecreasing nor nonincreasing:
FunctionMonotonicity[SawtoothWave[x], x]SawtoothWave is not injective:
FunctionInjective[SawtoothWave[{a, b}, x], x, Assumptions -> a < b]Plot[{SawtoothWave[x], .5}, {x, -7, 7}]SawtoothWave[x] is not surjective:
FunctionSurjective[SawtoothWave[x], x]Plot[{SawtoothWave[x], -1}, {x, -5, 5}]SawtoothWave[x] is non-negative:
FunctionSign[SawtoothWave[x], x]SawtoothWave is neither convex nor concave:
FunctionConvexity[SawtoothWave[{a, b}, x], x, Assumptions -> a < b]Differentiation and Integration (5)
First derivative with respect to
:
D[SawtoothWave[x], x]Derivative of the two-argument form with respect to
:
D[SawtoothWave[{a, b}, x], x]The second (and higher) derivatives are zero except at points where the derivative does not exist:
Simplify[D[SawtoothWave[{a, b}, x], {x, 2}], Assumptions -> b > a]If a==b, SawtoothWave[{a,b},x] is constant and its derivatives are zero everywhere:
Table[D[SawtoothWave[{a, a}, x], {x, k}], {k, 3}]Integrals over finite domains:
Integrate[SawtoothWave[x], {x, 0, 10}]Integrate[Exp[-x]SawtoothWave[x], {x, 0, 5}]Series Expansions (5)
FourierSeries[SawtoothWave[x], x, 3]Since SawtoothWave is odd except for a constant, FourierTrigSeries gives a simpler result:
FourierTrigSeries[SawtoothWave[x], x, 3]The two results are equivalent:
Simplify[% == %%]FourierCosSeries of a scaled SawtoothWave:
FourierCosSeries[SawtoothWave[(x/π)], x, 4]Taylor series at a smooth point:
Series[SawtoothWave[x], {x, 1 / 2, 3}, Assumptions -> x < 1]//NormalSeries expansion at a singular point:
Series[SawtoothWave[x], {x, 0, 3}, Assumptions -> x < 1]Taylor expansion at a generic point:
Series[TriangleWave[x], {x, x0, 2}]//Normal// FullSimplifyApplications (2)
Fourier decomposition of sawtooth wave signal:
FourierCoefficient[SawtoothWave[x], x, n, FourierParameters -> {1, 2Pi}]FourierSeries[SawtoothWave[x], x, 10, FourierParameters -> {1, 2Pi}]Plot[{SawtoothWave[x], %}, {x, 0, 2}, ExclusionsStyle -> Dotted]Play[SawtoothWave[440 x], {x, 0, 1}]Properties & Relations (4)
Use FunctionExpand to expand SawtoothWave in terms of elementary functions:
FunctionExpand[SawtoothWave[x], x∈Reals]Use PiecewiseExpand to obtain a piecewise representation over an interval:
PiecewiseExpand[SawtoothWave[x], 0 < x < 2]Plot[SawtoothWave[x]Sin[x], {x, 0, 2Pi}, Filling -> Axis]Integrate[SawtoothWave[x]Sin[x], {x, 0, 2Pi}]N[%, 20]SawtoothWave[x] is lower semicontinuous but not upper semicontinuous at the origin:
{Underscript[, x -> 0]SawtoothWave[x] ≤ SawtoothWave[0], Underscript[, x -> 0]SawtoothWave[x] ≥ SawtoothWave[0]}This differs from TriangleWave[x], which is both upper and lower semicontinuous, and thus continuous:
Underscript[, x -> 0]TriangleWave[x] ≤ TriangleWave[0] && Underscript[, x -> 0]TriangleWave[x] ≥ TriangleWave[0]As well as SquareWave[x], which is only upper semicontinuous:
{Underscript[, x -> 0]SquareWave[x] ≤ SquareWave[0], Underscript[, x -> 0]SquareWave[x] ≥ SquareWave[0]}Visualize the three functions:
GraphicsRow[Plot[#[x], {x, -1, 1}, IconizedObject[«Plot options»]]& /@ {SawtoothWave, TriangleWave, SquareWave}, ImageSize -> 500]Possible Issues (1)
SawtoothWave is not defined for complex arguments:
SawtoothWave[1.0 + 0.2 I]See Also
Related Guides
Related Links
History
Text
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.
APA
Wolfram Language. (2008). SawtoothWave. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SawtoothWave.html
BibTeX
@misc{reference.wolfram_2026_sawtoothwave, author="Wolfram Research", title="{SawtoothWave}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/SawtoothWave.html}", note=[Accessed: 11-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sawtoothwave, organization={Wolfram Research}, title={SawtoothWave}, year={2008}, url={https://reference.wolfram.com/language/ref/SawtoothWave.html}, note=[Accessed: 11-June-2026]}
