What is the curl of a vector field?
Type the three components P, Q and R of a vector field in x, y and z. The page gives curl F and div F.
- curl F
- (x z - x, x^2 - y z, z)
The curl of (x^2 z, e^y + x z, x y z) is (x z - x, x^2 - y z, z).
- div F
- x y + 2x z + e^y
curl F: (x z - x, x^2 - y z, z). The curl of (x^2 z, e^y + x z, x y z) is (x z - x, x^2 - y z, z).
How to calculate
Finds the curl and divergence of a vector field, checked numerically.
Example with the default inputs (P (i component) x^2 z, Q (j component) e^y + x z, R (k component) x y z): The curl of (x^2 z, e^y + x z, x y z) is (x z - x, x^2 - y z, z).
Method: curl F = (R_y − Q_z, P_z − R_x, Q_x − P_y), each partial derivative from a CAS, checked.
- Radians. An answer that fails its check is not shown.
Worked examples
Each example is checked against the calculator on every build.
- P (i component) x^2 z, Q (j component) e^y + x z, R (k component) x y z gives curl F (x z - x, x^2 - y z, z).Source: OpenStax Calculus Vol. 3 (Strang and Herman, 2016), 6.5, Ex. 6.52
- P (i component) y z, Q (j component) x z, R (k component) x y gives curl F (0, 0, 0), div F 0.Source: OpenStax Calculus Vol. 3 (Strang and Herman, 2016), 6.5, Ex. 6.56
- P (i component) e^x, Q (j component) y z, R (k component) -y z^2 gives div F -2y z + z + e^x.Source: OpenStax Calculus Vol. 3 (Strang and Herman, 2016), 6.5, Ex. 6.48
How it works
For a vector field F = (P, Q, R), where P, Q and R are functions of x, y and z, the page computes
- curl F = (R_y − Q_z, P_z − R_x, Q_x − P_y), and
- div F = P_x + Q_y + R_z,
where R_y means ∂R/∂y, and so on.
Partial derivatives. Each partial derivative comes from a computer algebra system (nerdamer, open source), with the other two letters held constant. The algebra runs after you start typing, in the background. Each is checked: at 15 fixed test points in x, y and z (values such as 0.21, −0.37, 0.57, 1.33, −0.91 and up to ±8.93), a five-point central difference with steps h = 0.001 × max(1, |value|) and h/2 must match the formula to 10⁻⁶ × max(1, |slope|) (plus 10⁻¹¹ × |f| / h for rounding). Points where the function is not real, or where the two steps disagree, are skipped; at least 3 must agree and none may disagree.
Simplifying. Each component, and the divergence, has the pairs of terms that cancel as written (A − A, the same text with opposite signs) removed, and is then simplified by three candidates: that form; the algebra’s expanded form; and that expanded form expanded again after each cos(u)² is written as 1 − sin(u)². The shortest written form is kept, and each expanded form must equal the unsimplified expression at the 15 test points to 10⁻⁹.
What you can type
- Each component is a function of x, y and z; a component may be a number such as 0.
- pi (or π) is π and e is Euler’s number.
- Operations: + − * / and ^; brackets group; numbers and letters side by side multiply (2x y z).
- Functions: sqrt, cbrt, ln (and log), log10, exp, abs, sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh and their inverses. Angles are in radians.
How answers are written
- curl F: the three components in brackets, separated by commas: (x z − x, x^2 − y z, z).
- div F: one expression, as MathML.
- Each expression uses the syntax you type. Terms that are numbers times powers of the letters come first, highest total degree first, then by the powers of x, y and z in that order; other terms follow; a constant comes last. In a product, the sign comes in front, then numbers and constants, then powers of letters in alphabetical order (a letter that appears twice is one power: v v is v^2), then the other factors. The same order applies inside brackets and function arguments, except that the first term with a plus sign is moved to the front: sqrt(1 − x^2 y^2).
- An answer whose text holds a decimal point or a whole number of 9 or more digits (a number the algebra rounded) is not shown.
Assumptions
- Right-handed x, y, z coordinates; angles in radians; ln is the natural logarithm.
- An answer that fails its check, finds no formula, or takes over 3 seconds is not shown ("No verified answer").
Worked examples by hand
F = (x²z, eʸ + xz, xyz) (OpenStax Calculus Volume 3, section 6.5, Example 6.52). R_y = xz and Q_z = x, so the first component is xz − x. P_z = x² and R_x = yz, so the second is x² − yz. Q_x = z and P_y = 0, so the third is z. curl F = (xz − x, x² − yz, z).
F = (yz, xz, xy) (Example 6.56). R_y − Q_z = x − x = 0, P_z − R_x = y − y = 0, Q_x − P_y = z − z = 0, so curl F = (0, 0, 0). Its divergence is 0 + 0 + 0 = 0.
F = (eˣ, yz, −yz²) (Example 6.48). div F = eˣ + z − 2yz, written by the page as −2y z + z + e^x (powers of letters first, highest degree first).
Other questions people ask
What is the curl of a vector field?
The curl of F = (P, Q, R) is the vector field ∇ × F = (∂R/∂y − ∂Q/∂z, ∂P/∂z − ∂R/∂x, ∂Q/∂x − ∂P/∂y). It measures how much the field turns around each point: for the flow of a fluid, curl F is twice the angular velocity of a tiny paddle wheel at that point, and its direction is the axis of the spin.
How do I find the curl of a 2D field?
Type the two components as P and Q and set R to 0. The curl is then (0, 0, ∂Q/∂x − ∂P/∂y), and its third component is the scalar curl used in Green’s theorem. For F = (y, 0) the curl is (0, 0, −1).
What does a curl of 0 mean?
A field with curl 0 everywhere is irrotational. On a region with no holes (simply connected), such a field is conservative: it is the gradient of a potential function f, and line integrals of F depend only on the end points. F = (yz, xz, xy) has curl 0 and is the gradient of f = xyz.
What is the divergence?
The divergence div F = ∂P/∂x + ∂Q/∂y + ∂R/∂z is a number at each point: the rate at which the field flows out of a small box around it. The page gives it too, from the same checked partial derivatives.
How is the answer checked?
Each of the partial derivatives comes from a computer algebra system and must match a numeric difference quotient at 15 test points in x, y and z. Each simplified component must equal the unsimplified difference at the same points. An answer that fails is not shown.
Why is my divergence not simplified to 0?
The page combines like terms and cancels equal terms, but it does not simplify every expression. For the gravitational field x/(x² + y² + z²)^(3/2) and so on, the divergence is 0 away from the origin, but the page may show it as a sum of fractions that add up to 0. The curl of that field shows as (0, 0, 0).