Mathematica turns a scientific computation into a single, readable line. You type the expression the way you'd write it on a blackboard, press Shift+Enter, and it comes back with the exact answer, a symbolic form, a numeric value, or a publication-quality picture — whatever you asked for. This guide covers the three verbs every engineer actually uses: calculate, solve, plot.
Simplify can act on the same expression you'd Plot, and why a symbolic solution can later become a numeric one with a single N[...] call.
Before syntax, you need the mental model. Mathematica's unit of work is the cell. You type an expression in an input cell, press Shift+Enter, and Mathematica sends the whole cell's content to a background process (the kernel) for evaluation. The result appears as a separate output cell below. Every subsequent cell can refer to previous results by their tag Out[7] = and to variables you have defined.
Solve[x^2 == 2 x + 1, x]
{{x -> 1 - Sqrt[2]}, {x -> 1 + Sqrt[2]}}
Three things follow from this design that most new users don't expect:
Solve returned the closed-form solutions, not two numbers. You can force numeric output with N[...], but you have to ask for it.{1, 2, 3}, a matrix, a function, a solution set — all live in the same data model, so functions compose cleanly.Shift+Enter on any earlier cell and Mathematica recomputes the whole notebook from that point. This is why people build a whole analysis in one document instead of many files.Every engineer's first surprise with Mathematica is that 1/3 stays as 1/3. There is no 0.333333 unless you ask for it. This isn't a bug: Mathematica treats 1/3 as an exact rational number, because the Wolfram Language keeps symbolic and numeric computation in one model.
1/3 → 1/32^100 → 1267650600228229401496703205376Sqrt[2] → √2N[Pi] → 3.14159Exact values carry full precision. 2^100 has all 31 digits because Mathematica never rounded them off.
N[1/3] → 0.333333N[2^100] → 1.26765×10²⁹N[Sqrt[2]] → 1.41421N[Sqrt[2], 50] → 1.41421356237… (50 digits)Numeric values are doubles by default (~16 digits) or, with N[expr, n], arbitrary-precision numbers you control.
The most important rule: a decimal point in an input forces a numeric value.
The trailing dot on the numerator promotes the whole expression to a double. Once you are in numeric land, exact arithmetic is gone for that expression. This is why Solve[x^2 == 2. x + 1, x] (note the dot in 2.) returns approximate roots, while Solve[x^2 == 2 x + 1, x] returns the closed form. You will meet this again throughout the guide.
Sqrt[...] would do, you are trading exactness for no gain.
N[expr, n] converts exact results to n-digit precision on demand.Every engineer's daily calculations — simplify an expression, differentiate, integrate, expand a Taylor series, solve a matrix equation — map to one Mathematica function per task. The functions read like verbs on the expression. Below, each block shows the input, the output, and what makes the call do what it does.
To simplify an expression, you write Simplify; to factor, Factor; to expand, Expand. They take one expression and return a transformed version.
Simplify[(x^2 - 1)/(x - 1)]
x + 1
Simplify cancels the common factor (x - 1) symbolically — it knows both the numerator and denominator factor over the reals, and it performs the cancellation exactly.
Factor[x^4 - 1]
(-1 + x) (1 + x) (1 + x^2)
The right-hand side is the factored form over the rationals. Mathematica factors by design; Expand is its inverse and multiplies everything out.
Differentiation and integration use the verbs D and Integrate. Because Mathematica is symbolic by default, these functions return symbolic results when they can — and when they can't, they leave the expression in integral form.
D[Sin[x] Cos[x], x]
Cos[x]^2 - Sin[x]^2
D[f, x] takes the derivative of f with respect to x. The output is cos²x − sin²x, which equals cos 2x — a simplification you'd get with Simplify.
Integrate[Exp[-x^2], {x, 0, Infinity}]
√π / 2
Integrate[expr, {x, a, b}] evaluates a definite integral. Mathematica evaluates the Gaussian integral exactly, giving the analytic form \(( \sqrt{\pi}/2 )\).
For Taylor and Maclaurin series, use Series:
Series[Sin[x], {x, 0, 6}]
x - x^3/6 + x^5/120 + O[x]^7
Series[expr, {x, x0, n}] returns the Taylor series of expr around x = x0 to order n. The O[x]^7 term marks the remainder — Mathematica's way of saying "there's more here that I'm not writing down."
Matrices are just nested lists. Standard linear-algebra operations — solve a linear system, compute eigenvalues, invert a matrix — are all one-word functions.
A = {{2, 1}, {1, 3}}; b = {5, 4}; LinearSolve[A, b]
{1, 1}
LinearSolve[A, b] returns the vector x satisfying \((A x = b)\). It uses symbolic exact arithmetic by default, so the answer is exact.
Eigenvalues[{{0, 1}, {2, 3}}]
{(3 - Sqrt[13])/2, (3 + Sqrt[13])/2}
Eigenvalues are returned as exact radicals by default. Call N[%] to get numeric approximations.
N and NestOnce you have an exact symbolic result, converting it to a number is a one-character function: N. If you want higher precision, pass a precision: N[expr, 50]. For iterating a function k times — e.g. f(f(f(x))) — use Nest.
Nest[#^2 + 1 &, 10, 2]
10202
Nest[f, x, k] applies f to x a total of k times. Here (x → x² + 1) is applied twice to 10: 10 → 101 → 10202. The & at the end of the pure function is how Mathematica signals "the function body is done."
Simplify, Factor, D, Integrate, Series, LinearSolve, Eigenvalues, N. Each is a one-word function on an expression; results are exact by default and can be numerically approximated with N.The verbs here form a spectrum from "give me every solution, exactly" to "give me one numeric answer fast". Which one you pick depends on what the equation looks like and what you need.
SolveReduce for a full characterizationNSolveFindRootDSolve (exact)NDSolve (numeric)Solve: algebraic equations, all solutionsSolve[eqn, x] returns a list of rules, one per solution, in the form {x → value}. The rules are usable directly — you can substitute them into another expression with expr /. solution. This "rules everywhere" style is one of the cleanest parts of Mathematica.
Solve[x^2 - 3 x + 2 == 0, x]
{{x -> 1}, {x -> 2}}
Solve[x^3 - 1 == 0, x] /. x -> N[x]
{{x -> 1.}, {x -> -0.5 + 0.866025 I}, {x -> -0.5 - 0.866025 I}}
Solve always returns every complex root. The third root is complex — the cube roots of unity — and Mathematica includes it automatically. If you only want real roots, use Solve[eqn, x, Reals].
NSolve: numeric all-solutionsNSolve[eqn, x] is the numeric sibling of Solve. It's the right choice when your equation is a polynomial in several variables, or when the coefficients are already numeric and you want every root as a number.
NSolve[Sin[x] == 0.5, x, {x, -Pi, Pi}]
{{x -> 0.523599}, {x -> 2.61799}}
The third argument {x, -Pi, Pi} restricts x to a real interval. Without it, NSolve would return infinitely many roots — so the box is required for transcendental equations.
FindRoot: one numeric root from a guessWhen you have a nonlinear equation with no closed form and you only need one root, FindRoot is the workhorse. It takes an initial guess and iterates numerically (Newton-like).
FindRoot[Exp[-x] == x, {x, 0.5}]
{x -> 0.567143}
The third argument {x, 0.5} tells FindRoot the starting value. Different starting values can lead to different roots in multi-root problems — so pick the guess with physical meaning.
Reduce: full characterizationFor inequalities and logical conditions, Reduce gives a complete description of the solution set:
Reduce[x^2 < 4 && x > 0, x, Reals]
0 < x < 2
Reduce answers "for what values of x is this expression true?" as a human-readable condition. It is the tool for parameter ranges, stability margins, and feasibility checks.
DSolve and NDSolveFor an ordinary differential equation, DSolve attempts a closed-form solution and NDSolve integrates numerically. Both take the equation plus initial conditions as the first argument.
DSolve[{y''[t] + y[t] == 0, y[0] == 1, y'[0] == 0}, y[t], t]
{{y[t] -> Cos[t]}}
DSolve takes a list of equations (the ODE plus initial conditions), the unknown as a function y[t], and the independent variable t. The result is the closed-form solution.
NDSolve[{x''[t] + 0.1 x'[t] + x[t] == 0, x[0] == 1, x'[0] == 0}, x, {t, 0, 30}]
{x -> InterpolatingFunction[{{0., 30.}}, ...]}
When an ODE has no closed form — e.g. the Van der Pol oscillator — NDSolve returns an InterpolatingFunction: a numerical object you can evaluate at any point in the domain. That object plugs straight into Plot.
Solve and Reduce are symbolic and exhaustive; NSolve is the numeric multi-solution version; FindRoot is a fast single-root workhorse; DSolve and NDSolve handle ODEs exactly and numerically. Solutions come back as rules, ready to substitute with /. .Plotting in Mathematica has one unusual feature: you never write a "plot function" and then call it. You just write Plot[expr, {x, x0, x1}] and Mathematica figures out the sampling, the y-range, the tick marks, and the colors. The function Plot is a directive: it takes the expression and the domain and produces a picture.
Plot[f[x], {x, a, b}]ParametricPlot[{x(t), y(t)}, {t, a, b}]Plot3D[f[x,y], {x, a, b}, {y, c, d}]BarChart[data]DensityPlot[f[x,y], {x, a, b}, {y, c, d}]ListPlot[data][expression, {variables}]. Mathematica infers ranges, ticks, and coloring from the expression.Plot: the workhorseThe call is Plot[expr, {x, x_min, x_max}]. That's it. Mathematica picks a sensible vertical range, samples adaptively, and colors the curve.
Plot[Sin[x], {x, 0, 2 Pi}]
Plot with optionsOptions are keyword-value pairs in square brackets, separated by commas, at the end of the call. This is the same style used by most Wolfram functions.
Plot[Sin[x], {x, 0, 2 Pi},
PlotLabel -> "Sine over one period",
AxesLabel -> {"x", "sin x"},
PlotStyle -> Red,
Frame -> True]
PlotLabel, AxesLabel, PlotStyle, Frame are options that customize the picture. Mathematica accepts thousands of these for different functions — a single language for "how to render this result."
To plot multiple expressions on the same axes, pass a list as the first argument:
Plot[{Sin[x], Sin[2 x], Sin[3 x]}, {x, 0, 2 Pi},
PlotLegends -> Automatic]
The list form is the same convention used by ListPlot, ParametricPlot, and everything else in the plotting family. PlotLegends -> Automatic auto-generates labels.
Plot3D takes the function of two variables and two ranges:
Plot3D[Exp[-(x^2 + y^2)], {x, -3, 3}, {y, -3, 3}]
ContourPlot shows level sets of f(x, y); DensityPlot shades by value; VectorPlot draws a field of vectors. Each takes the same [expr, {x, ...}, {y, ...}] shape — you pick the function, the rest is automatic.
ManipulateOnce you have a plot, wrapping it in Manipulate[plot, {param, pmin, pmax}] adds sliders for the parameters you mention. The plot updates live as you drag.
Manipulate[
Plot[Sin[a x + b], {x, 0, 2 Pi}],
{a, 1, 5},
{b, 0, 2 Pi}]
This is the pattern for exploratory work: write the plot as a function of parameters, wrap it in Manipulate, and let Mathematica build the UI for you. A whole analysis can be turned into a "toy" you can feel.
Plot[expr, {x, x0, x1}] is the whole story. Options customize the picture; lists overlay curves; Plot3D, ContourPlot, and DensityPlot use the same shape for higher dimensions; Manipulate adds sliders to any plot.Let's put everything together. The damped harmonic oscillator is the classic equation an engineer will encounter: mass, spring, and dashpot in series.
where m is mass, c is damping, k is stiffness, and \((\zeta = c/(2\sqrt{mk}))\) is the dimensionless damping ratio. The three regimes of interest — underdamped (\((\zeta < 1)\)), critically damped (\((\zeta = 1)\)), and overdamped (\((\zeta > 1)\)) — come straight from solving the characteristic equation.
sol = DSolve[
{x''[t] + 2 z wn x'[t] + wn^2 x[t] == 0,
x[0] == 1, x'[0] == 0}, x[t], t]
{{x[t] -> ... closed form in z, wn, t}}
DSolve returns the exact solution as a rule. Assigning it to sol keeps it in the notebook's state for later substitution.
Plot[x[t] /. First[sol] /. {z -> 0.3, wn -> 1},
{t, 0, 20},
PlotLabel -> "Underdamped, ζ = 0.3"]
The chain /. First[sol] /. {z -> 0.3, wn -> 1} substitutes the symbolic solution and then the numeric parameters — two rule substitutions in one line.
Manipulate[
Plot[x[t] /. First[sol] /. {z -> zeta, wn -> 1},
{t, 0, 20},
PlotRange -> {-2, 2},
PlotLabel -> "ζ = " <> ToString[zeta]],
{zeta, 0.01, 2}]
Now the whole behavior — underdamped ringing, critical damping, overdamped monotone decay — is one slider away. This is what "interactive symbolic computation" means in practice.
To check that the symbolic solution is right, integrate numerically and compare:
num = NDSolve[
{x''[t] + 2*0.3*1*x'[t] + 1^2*x[t] == 0,
x[0] == 1, x'[0] == 0}, x, {t, 0, 20}];
Plot[{x[t] /. First[sol] /. {z -> 0.3, wn -> 1},
x[t] /. First[num]},
{t, 0, 20}, PlotLegends -> {"symbolic", "numeric"}]
Manipulate turns any parameter into a slider with one line of code.The plot below is a live rendering of the same equation — not Mathematica, but a plain-canvas implementation of Plot[Sin-like damped curve] so you can feel the workflow even without Mathematica. Drag the sliders to see how the damping ratio and natural frequency reshape the response. When you're in Mathematica, the same picture comes from a single Manipulate[Plot[...], {zeta, 0.01, 2}, {wn, 0.5, 3}].
Manipulate; the canvas is the Plot output; the regime badge is a Reduce-style classification of ζ. The pattern is identical — only the implementation differs.
Once you can calculate, solve, and plot, the questions become about when each tool is right. A few traps show up constantly:
As noted in §2, a decimal point in a coefficient makes the whole solve numeric:
Solve[x^2 == 2 x + 1, x] — exact coefficients
{{x -> 1 - Sqrt[2]}, {x -> 1 + Sqrt[2]}}
Solve[x^2 == 2. x + 1, x] — note the dot in 2.
{{x -> -0.414214}, {x -> 2.41421}}
Same equation, different answer style. If you need the closed form, don't introduce a decimal anywhere in the input.
Solve returns a list of rulesBeginners write sol = Solve[eqn, x] and then try to use sol directly. It won't work — sol is a list, so sol[[1]] gives the first rule and x /. First[sol] substitutes into an expression. Learn the indexing and the /. operator early.
FindRoot needs a guess; NSolve does notThese two are often confused. NSolve finds every solution in a bounded region. FindRoot finds one solution near your starting value. Use NSolve for polynomials; use FindRoot for transcendental or stiff problems where a single physical solution matters.
Integrate can fail silentlyIf Integrate can't find a closed form, it returns the integral unevaluated. Check the output — a symbol like Integrate[...] in your result means Mathematica gave up, and you should switch to NIntegrate for a numeric value.
Plot options vs. functionsOptions go at the end of a call in square brackets: Plot[..., PlotStyle -> Red]. A function you write in the expression is f[x]. Mixing these up is a common first-week error.
/. substitution operatorThe double-dot operator /. (pronounced "slash dot" or "rule-apply") applies a rule to an expression: expr /. x -> 5 replaces every x in expr with 5. It is the reason solutions from Solve are useful — they are rules, ready to substitute.
Reduce instead of SolveSolve returns a list of rules for each solution. Reduce returns a single logical statement describing the full solution set, including inequalities. Use Reduce when you need "for what parameters is this stable?" rather than "what are the roots of this polynomial?".
Solve returns a list of rules, prefer NSolve for polynomial all-roots and FindRoot for a single fast root, and use /. to plug solutions back in.Three verbs, one model:
Simplify, Factor, D, Integrate, Series, LinearSolve, Eigenvalues, N. One function per task, exact by default.Solve (all symbolic), NSolve (all numeric), FindRoot (one fast), Reduce (full characterization), DSolve / NDSolve (ODEs). Results are rules, ready for /. .Plot[expr, {x, a, b}] is the workhorse; lists overlay; Plot3D, ContourPlot, DensityPlot share the shape; Manipulate adds sliders.The design that makes all three coherent: the Wolfram Language treats every result — expression, number, matrix, function, solution, plot — as the same kind of object. That is why N turns a symbolic result numeric, why Plot takes an expression and produces a picture, and why Manipulate can put a slider on any parameter of any expression.
Written as an offline, self-contained HTML document. Math typeset with KaTeX (fonts embedded as data URIs — no network dependencies).
For discussion and refinement, ask me questions below — I'll update the page to answer them.