Chapters

Calculus basics

Calculus is the mathematics of change and of accumulation. It answers two questions that ordinary arithmetic cannot: "how fast is this changing right now?" and "how much has piled up in total?" The first question leads to the derivative, the second to the integral, and a single beautiful idea ties the two together. This chapter builds the concepts from the ground up, then shows exactly how Castiel computes them — both as plain numbers and as algebraic expressions.

If calculus is new to you, read the concept sections in order. If you only want the keys, jump to Computing calculus in Castiel.


Limits: getting arbitrarily close

Everything in calculus rests on the idea of a limit — what a quantity approaches as its input approaches some value, even if it never quite arrives.

Picture the expression as x creeps toward 2. At x = 1.9 it is 3.61; at 1.99 it is 3.9601; at 1.999 it is 3.996. The value is homing in on 4, and we write this as "the limit of as x approaches 2 is 4." Here the limit is just the value you would get by substituting — no drama.

Limits earn their keep when substitution fails. Consider (x² − 1) / (x − 1) as x approaches 1. Put x = 1 in directly and you get 0 / 0, which is meaningless. But watch the approach: at x = 1.1 the expression is 2.1, at 1.01 it is 2.01, at 1.001 it is 2.001. It is closing in on 2. The limit exists and equals 2, even though the formula is undefined at the point itself. A form like 0/0 is called indeterminate: its value is not fixed by the form alone, and finding the limit is the whole job.

A limit can also be one-sided. Approaching from below (the left) and from above (the right) can give different answers; when they disagree, the two-sided limit does not exist. And a limit point can be infinity — "what does this approach as x grows without bound?" These distinctions matter because the derivative, next, is defined as a limit.


The derivative: a rate of change

A derivative measures how fast one quantity changes as another changes — the instantaneous rate of change.

The intuitive picture: speed. Suppose you record a car's distance from home every second. Over a stretch where it travels 20 metres in 2 seconds, its average speed is 10 metres per second. But speedometers do not show averages; they show the speed right now. To get the instantaneous speed, you measure the distance change over a smaller and smaller time interval — 1 second, then 0.1, then 0.01 — and see what the average speed approaches. That limiting value is the derivative of distance with respect to time. Speed is the derivative of distance. Acceleration, in turn, is the derivative of speed.

The geometric picture: slope. Draw a curve on a graph. Pick a point on it and draw the straight line that just grazes the curve there — the tangent. The steepness of that tangent line is the derivative at that point. Where the curve climbs steeply the derivative is large and positive; where it falls the derivative is negative; at the crest of a hill, where the curve is momentarily flat, the derivative is exactly zero. This is why derivatives find maxima and minima: the high and low points of a curve are where its slope passes through zero.

For a formula, the derivative is itself a formula. The derivative of is 2x: at x = 3 the slope is 6, at x = 5 it is 10. That rule — bring the power down as a multiplier and reduce it by one — is the power rule, and Castiel knows it and every other standard rule (product, quotient, chain, and the derivatives of sin, cos, exp, ln, and the rest).


The integral: accumulated area

An integral runs the other way: instead of asking how fast something changes, it adds up a changing quantity to find a total. Geometrically, the integral of a function is the area between its curve and the horizontal axis.

Why area is a total. If a graph shows speed against time, then the height at each moment is the speed and the width is a slice of time; height times width is a small distance. Add up all those thin slices under the speed curve and you get the total distance travelled. Area under a rate-of-change curve is the accumulated amount. This is what makes integrals useful far beyond geometry — total distance, total charge, total cost.

The definite integral. When you integrate between two specific values — a lower bound a and an upper bound b — you get one number: the area under the curve from a to b. This is the definite integral, written with a bottom and top limit. For example, the area under y = x² from 0 to 1 works out to exactly 1/3. That single number is the answer.

The indefinite integral. Integrating without bounds asks a different question: "what function has this as its derivative?" The answer is a function, called an antiderivative, not a number. The antiderivative of is x³/3, because the derivative of x³/3 is . (Strictly, any constant could be added — the derivative of a constant is zero — so mathematicians write "+ C". Castiel omits the + C; add your own constant when a problem fixes it.)


Derivatives and integrals are not two separate topics that happen to share a chapter. They are inverses of each other — each undoes the other. Differentiating an antiderivative returns the function you started with; integrating a derivative rebuilds the original (up to a constant).

This is the fundamental idea of calculus, and it gives a shortcut for definite integrals. To find the area under from 0 to 1, you do not add up infinitely many slivers by hand. You find an antiderivative — x³/3 — and simply subtract its value at the two ends: (1³/3) − (0³/3) = 1/3. The area is the change in the antiderivative between the bounds. Every definite integral in Castiel is built on this principle.


Summation: adding up a pattern with Σ

Before the integral's smooth accumulation there is its discrete cousin: the sum. The Greek capital sigma, Σ, means "add these up." Beneath the Σ you write where a counter starts, above it where the counter stops, and to the right the thing to add for each step.

For instance, Σ of k for k running from 1 to 100 means 1 + 2 + 3 + … + 100, which totals 5050. Summation appears throughout mathematics — averages, series, and the very definition of the integral, which is the limit of a sum of ever-thinner slices. Castiel gives Σ its own template key so you can add up a pattern without typing every term.


Computing calculus in Castiel

The School calculator, showing the ∫, d/dx, and Σ template keys on the scientific keypad
The School calculator, showing the ∫, d/dx, and Σ template keys on the scientific keypad

Castiel computes calculus in two distinct ways, and the difference is worth understanding before you press a key.

  • A numeric result is a plain number. The School calculator does calculus numerically: you build a definite integral, a derivative, or a sum with the template keys, press =, and get a value such as 0.3333....
  • A symbolic result is an algebraic expression. Engineer mode's CAS does calculus symbolically: ask it to differentiate and it returns the formula 2x; ask it to integrate and it returns x³/3.

Use the numeric route when you want an answer for specific numbers. Use the symbolic route when you want the general rule or an exact algebraic form.

The School template keys. On the scientific keypad, row two carries three calculus templates:

  • inserts a definite integral. It gives you three slots to fill: the lower limit, the upper limit, and the expression (the body). Because it always carries bounds, the School integral is definite — it produces a number.
  • d/dx inserts a derivative of the expression you type into it.
  • Σ inserts a summation, with slots for the start value, the end value, and the expression to add.

Fill a template's slots, moving between them, then press = to evaluate. The numeric results also flow to the "Show working" tape beside the keypad, in textbook notation.

Exact versus decimal. A numeric answer that happens to be a "nice" value can be shown either as a fraction or as a decimal. Press S⇔D to toggle: the area 1/3 can appear as the exact fraction 1/3 or as the decimal 0.3333.... Toggle to whichever form you need.

The symbolic surface. In Engineer mode's CAS you choose an operation and give it an expression. The calculus operations available are d/dx (differentiate), (integrate, without bounds — an antiderivative), lim (limit), and Taylor (a polynomial approximation). Symbolic integration finds an antiderivative when one exists in closed form; some integrands genuinely have none, and the CAS then returns the integral unevaluated rather than a wrong answer.


The calculus operations

Operation What it does Where Result
Definite integral area under a curve between two bounds template key (School) a number
Derivative rate of change / slope of an expression d/dx template key (School) a number
Summation adds a pattern between a start and end count Σ template key (School) a number
Differentiate the derivative as an expression d/dx operation (Engineer CAS) an expression
Integrate an antiderivative (no + C) operation (Engineer CAS) an expression
Limit the value an expression approaches lim operation (Engineer CAS) a value
Taylor a polynomial that approximates a function near a point Taylor operation (Engineer CAS) an expression

Symbolic differentiation on the CAS handles one variable at a time. Symbolic summation is not on the CAS surface; for a numeric total, use the School Σ template.


Worked examples

Example 1 — a definite integral (the template, numeric). Find the area under y = x² between x = 0 and x = 1.

By hand, the antiderivative of is x³/3, so the area is (1³/3) − (0³/3) = 1/3. Here is the same result on the School calculator:

  1. Press the key. A definite-integral template appears with empty slots for the lower limit, the upper limit, and the body.
  2. Type 0 into the lower slot and 1 into the upper slot.
  3. In the body slot, enter the expression (type x, then raise it to the power 2).
  4. Press =. The result is 0.3333....
  5. Press S⇔D to switch that decimal to its exact form, 1/3. The area under from 0 to 1 is exactly one third.

Example 2 — a derivative, numeric and symbolic. Differentiate .

The symbolic answer (Engineer CAS). Switch to Engineer mode, choose the d/dx operation, and give it . The result is the expression 2x — the general rule for the slope at any point. This is a formula, not a number: at x = 3 it says the slope is 6, at x = 5 it says 10, all in one answer.

The numeric answer (School d/dx template). On the School calculator, press the d/dx key and type the expression into the derivative template. Where the symbolic route hands back the rule 2x, the numeric route evaluates the rate of change and reports it as a single number. Press S⇔D to move that result between exact and decimal form.

The contrast is the lesson: the same operation gives you a number when you want a concrete value, and an expression when you want the general rule. Reach for the School templates when your problem has specific numbers, and for the Engineer CAS when you want the algebra.


See also

  • The School calculator — the surface with the , d/dx, and Σ template keys used above.
  • Engineer CAS — the symbolic surface that returns expressions rather than numbers.
  • Numerical methods — how Castiel computes integrals, derivatives, and roots as numbers when no exact form is wanted.