Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Domain of a Function


Logarithmicg(x) = ln(x)
×
880 × 460
Domainx > 0
-10-8-6-4-20246810
Test point
x = 1
✓ in domaing(1) = 0
Applieda=1k=0b=1h=0b, h affect domain







Getting Started with the Visualizer

Open the page and three panels appear. On the left is the function picker with eleven base functions grouped by domain shape — those that accept every real number, and those with built-in domain restrictions. In the center is the plot panel with the function g(x)g(x) in blue and a colored band drawn directly on the x-axis showing the domain. On the right is the info panel with two tabs.

Below the plot sits the domain card — a colored block displaying the domain in interval notation, the same domain drawn on a horizontal 1D number line, and a draggable test point slider that lets you check whether a specific x-value is in the domain and, if so, see the value g(x)g(x) that the function produces there.

The page launches with the logarithmic family. Its domain is x>0x > 0 — the function is undefined for zero and negative inputs. The x-axis band starts just to the right of 00 with an open endpoint and extends rightward; the test point at x=1x = 1 shows g(1)=0g(1) = 0.

Picking a Function

The picker groups eleven base functions by the shape of their domain:

Unrestricted (R\mathbb{R}) — Identity, Linear (2x), Quadratic, Cubic, Exponential, Sine, Cosine, Absolute. All accept every real number as input.
RestrictedLogarithmic (domain x>0x > 0), Square root (domain x0x \geq 0), Reciprocal (domain x0x \neq 0). Each has a built-in restriction baked into its definition.

The grouping is the pedagogical point. Most functions you encounter in pre-calculus accept any input; the three families that don't are the canonical cases worth studying — and the ones where transformations actually move the domain boundary around. Picking an unrestricted family is useful for contrast: the colored band on the x-axis just extends from -\infty to ++\infty, and changing parameters doesn't move it.

Click any entry to switch. Transformation parameters reset to defaults on every switch.

Why Only bb and hh Change the Domain

Below the family list, four sliders apply the standard affine transformations:

aavertical scale. Multiplies the output by aa.
kkvertical shift. Adds kk to the output.
bbhorizontal scale. Multiplies the input by bb.
hhhorizontal shift. Subtracts hh from the input.

A small "affects domain" badge appears on the labels for bb and hh but not on aa or kk. The reason is structural and the mirror image of the range case. The transformed function is g(x)=af(b(xh))+kg(x) = a \cdot f(b(x - h)) + k. The input that reaches the inner ff is b(xh)b(x - h) — only bb and hh appear there. After ff produces a value, aa and kk scale and shift it, but by then the legality of the input has already been decided.

Drag aa or kk as wildly as you want — the x-axis band does not move. Drag bb or hh and the band immediately rescales and shifts. The visualizer makes this asymmetry visible in real time.

Reading the X-Axis Highlight and Domain Bar

The domain is shown in two coordinated places:

On the x-axis of the main plot — a colored band traces the interval of legal inputs directly on the axis, in the same coordinate system as the function. You can see which inputs the blue curve has values at and which it leaves blank. Open and closed endpoints render as hollow and filled circles; infinite extents render as arrows.

On a horizontal number line below the plot — the same domain interval is drawn flat, in the more familiar number-line orientation with tick marks and integer labels every two units. The number line view sits in its own colored card and is easier to read at a glance.

The two views always agree. The on-axis version makes the geometric relationship between input restrictions and the curve unmistakable; the number-line version is the canonical representation you would draw by hand.

For excluded domains like the reciprocal, both views mark the excluded value with a red ×, showing the hole in the domain visually.

Probing with the Test Point Slider

Inside the domain card sits a test point slider labeled "x = ...". Drag it from 10-10 to +10+10 along the number line. As you move:

• The slider's thumb on the number line jumps to that position, with a vertical marker and a filled circle.
• A dashed vertical reference line appears in the main plot at the corresponding xx value — drawn in the highlight color when the input is in the domain, and red when it is not.
• Below the slider, an "in domain" or "outside domain" badge updates with the result.
• Next to the badge, the actual function value appears: g(x)=g(x) = \ldots for legal inputs, or "g(x)g(x) is undefined" for inputs outside the domain.

The function value display is the key difference from the range visualizer. Where the range tool only answers achievability, the domain tool tells you *what comes out* whenever the input is legal — so you can use it as both a domain checker and a quick function evaluator.

The Domain Card and Applied Chips

At the top of the domain card, the domain in interval notation is displayed as a monospace string — e.g., x>0x > 0, x0x \geq 0, x0x \neq 0, or "all real x" for unrestricted families. This is the same string you would write on a homework assignment.

Below the plot, an Applied strip shows the four transformation parameter chips with their current values. The four chips are deliberately dimmed compared to other visualizers in the series; a separator and a "b, h affect domain" callout reinforce which parameters actually matter for this tool's question. Even though aa and kk appear in the strip, they are visually de-emphasized — a visual reminder that they could be at any value and the domain would still be the same.

The card's border color, header text, and accent badges all derive from the chosen highlight color, so the entire domain UI reads as one coordinated block.

Customizing the Highlight Color

Under the family picker and parameter sliders, an Appearance section contains a color swatch labeled "Domain color". Click it to open a native color picker and choose any color you want for the domain highlight, the domain card chrome, the number-line band, and the dashed reference line.

The color cascades through several visual elements simultaneously:

• X-axis highlight band in the plot
• Number-line fill below the plot
• Dashed vertical reference line when the test point is in domain
• Domain card border, header text, and "in domain" badge
• "Affects domain" badges on the relevant parameter sliders

Outside-domain elements (the red badge, the red reference line, the red × at excluded points) remain red regardless of the chosen highlight color — the contrast between "valid" and "invalid" is preserved.

What Is the Domain of a Function?

The domain of a function is the set of inputs where the function is defined — equivalently, the set of xx-values for which f(x)f(x) produces a real number output. Inputs outside the domain are forbidden; the function simply has no value there.

Different function families have qualitatively different domain restrictions:

• Polynomials (xx, x2x^2, x3x^3, x|x|), exponential exe^x, sine, and cosine accept every real number. Their domain is all of R\mathbb{R}.
x\sqrt{x} — defined only for x0x \geq 0, since the square root of a negative number is not real
ln(x)\ln(x) — defined only for x>0x > 0, since the logarithm of zero or a negative number is not real
1/x1/x — defined everywhere except x=0x = 0, since division by zero is undefined

Domain is independent of range. A function can have a tiny domain and reach every real number (lnx\ln x has domain x>0x > 0 but range R\mathbb{R}), or accept every real number and stay bounded (sinx\sin x has domain R\mathbb{R} but range [1,1][-1, 1]). Together, domain and range fully characterize what goes in and what can come out.

Open vs Closed Endpoints and Excluded Values

Three subtle distinctions show up in the visualizer's domain bar:

Closed endpoint (filled circle) — the boundary value is *included* in the domain. Square root has domain x0x \geq 0 with a closed endpoint at 00, because 0=0\sqrt{0} = 0 is defined. The bar shows a filled dot.

Open endpoint (hollow circle) — the boundary value is *excluded* from the domain. Logarithm has domain x>0x > 0 with an open endpoint at 00, because ln(0)\ln(0) is undefined (the limit is -\infty). The bar shows a hollow dot.

Excluded value (red ×) — the function is defined everywhere except one value. Reciprocal has domain x0x \neq 0 — every nonzero real number is a legal input, but 00 is the vertical asymptote and forbidden. The bar shows a full fill broken by a small red × at the excluded point.

The distinction between open and closed endpoints matters for continuity, limits, and whether a function attains its extreme values. The visualizer makes the boundary type visible by eye, so the difference reads at a glance rather than as an abstract notation.

Functions Defined on All of the Reals

Eight of the picker's eleven functions accept every real input: the identity, the scaled linear, the quadratic, the cubic, the exponential, sine, cosine, and the absolute value. Their domain bar is one unbroken green band from edge to edge.

For these families the domain story is deliberately boring — and that is worth seeing. Whatever bb and hh you dial in, an all-of-R\mathbb{R} domain maps onto all of R\mathbb{R} again: shifting or rescaling the whole real line gives back the whole real line. The interesting cases live in the restricted group.

The Identity Function

The identity f(x)=xf(x) = x accepts everything and changes nothing — the baseline case for every domain question.
-10-5510-55f(x) = x
f(x) = x, domain frozen

The identity line over one unbroken green band: every real input accepted, none changed.

Its green band spans the axis with no endpoints to mark, and no slider can break it: transformed, the identity just becomes another line, and lines are domain-proof.

Its real use in this tool is as a control: switch here after a restricted family and watch every red mark vanish — the difference you just saw was the function's doing, not the sliders'.

The Scaled Linear Function

The line f(x)=2xf(x) = 2x doubles its input — and doubling is something every real number tolerates.
-10-5510-55f(x) = 2x
f(x) = 2x, domain frozen

The doubled line f(x) = 2x over a full green band — scaling an input is never a reason to refuse it.

Like the identity, its domain is all of R\mathbb{R} under every parameter setting. What the scaling *does* move is the range and the steepness — a reminder that domain (allowed inputs) and range (produced outputs) are independent questions.

Every polynomial shares this immunity: addition and multiplication never refuse an input. Division and even roots are where refusals start — the theme of the restricted families.

The Quadratic Function

Squaring accepts every real number — negative inputs included — so the parabola's domain bar is solid green.
-10-5510-55f(x) = x²
f(x) = x², domain frozen

The parabola over a solid green band: inputs unrestricted, even though outputs never go negative.

The quadratic is the classic place where students first confuse domain with range: the outputs never dip below zero, but the *inputs* are unrestricted. The visualizer separates the two visually — the green band on the x-axis is about inputs only, and it never shrinks however the parabola moves.

Note the contrast with its inverse: undoing a square means taking a square root, and *that* function pays for the parabola's generosity with a halved domain.

The Cubic Function

Cubing accepts every real input and — unlike squaring — returns every real output too.
-10-5510-55f(x) = x³
f(x) = x³, domain frozen

The cubic over a full green band — unrestricted in domain and range alike.

Domain R\mathbb{R}, range R\mathbb{R}: the cubic is unrestricted in both directions, which is why its inverse (the cube root) is also defined everywhere, needing none of the caution the square root demands. Odd powers never refuse an input and never repeat an output.

In the tool this makes the cubic the cleanest demonstration that aa, kk, bb, hh all leave the green band alone — there is simply nothing to break.

The Exponential Function

The exponential exe^x takes any real exponent — its domain is the whole line, even though its outputs never leave positive territory.
-10-5510-55f(x) = eˣ
f(x) = eˣ, domain frozen

eˣ over a full green band: any exponent is welcome, however negative, and the answer is just very small.

That mismatch is the exponential's signature: domain R\mathbb{R}, range (0,)(0, \infty). Feed it 1000-1000 and it answers with a very small positive number, not a refusal.

The refusals belong to its inverse: the logarithm inherits the exponential's *range* as its domain — positive inputs only. Inverting a function swaps domain and range, and this pair is the tool's best illustration of the swap.

The Sine Function

Sine accepts any angle — wind around the circle as many times as you like — so its domain is all of R\mathbb{R}.
-10-5510-55f(x) = sin(x)
f(x) = sin(x), domain frozen

The endless wave over an endless green band — any angle, wound any number of times.

Periodicity and full domain go together: the wave repeats forever in both directions with no boundary to mark. The bounded part of sine's story is its *range*, locked inside [1,1][-1, 1].

Contrast this with tangent — periodic but riddled with excluded points at every half-period. Periodicity alone tells you nothing about domain; it is the division inside tangent that punches the holes, the same mechanism as the reciprocal's excluded point.

The Cosine Function

Cosine, like sine, accepts every real input — the same endless wave, shifted a quarter period.
-10-5510-55f(x) = cos(x)
f(x) = cos(x), domain frozen

The same full-domain picture as sine, shifted a quarter period.

Everything said about sine's domain transfers verbatim: unbroken green band, immunity to all four sliders, range trapped in [1,1][-1, 1].

The pair is useful in this tool for a subtler point: two different functions can have *identical* domain behavior. Domain is a coarse fingerprint — it distinguishes the logarithm from the sine instantly, but cannot tell sine from cosine at all.

The Absolute Value Function

The absolute value x|x| happily accepts negatives — it just strips their sign — so its domain runs the whole axis.
-10-5510-55f(x) = |x|
f(x) = |x|, domain frozen

The V over a solid green band: the corner at zero is a smoothness issue, not a domain one.

The V-shape has a corner, and a corner is a *differentiability* problem, not a domain problem: the function is defined and continuous everywhere, including at x=0x = 0. The green band takes no notice of the kink.

That distinction — defined everywhere versus smooth everywhere — is worth one deliberate look here, because the domain bar and the curve tell different stories at the corner point.

The Restricted Families

Three functions in the picker refuse some inputs, one for each classic reason: the logarithm needs strictly positive input (an open boundary), the square root needs non-negative input (a closed boundary), and the reciprocal refuses exactly one value (an excluded point).

Open half-line, closed half-line, punctured line — these three shapes, moved and scaled by bb and hh, cover nearly every domain you will meet before calculus. The endpoint distinction between them is exactly what the visualizer's markers encode.

The Logarithm and Its Open Boundary

The logarithm demands strictly positive input: its domain is (0,)(0, \infty), and the boundary point itself is not included.
-10-5510-55f(x) = ln(x)
ln(x), domain frozen

Red band to the left, green strictly to the right, and the open circle at x = 0 recording the refusal: the boundary point itself is not allowed.

The open circle at x=0x = 0 is the whole story: ln(0)\ln(0) does not exist — the curve dives toward -\infty as the input approaches zero, but zero itself is refused. Red band left of the marker, green strictly right of it.

Drag hh and the wall slides to x=hx = h, open circle and all; flip bb negative and the inequality reverses — the domain becomes (,h)(-\infty, h), the green and red bands trading sides. This is the parameter rule acting on a boundary you can watch.

Compare the square root's closed dot: one pixel of difference on screen, a real mathematical distinction underneath.

The Square Root and Its Closed Boundary

The square root accepts zero — 0=0\sqrt{0} = 0 is a perfectly good value — so its domain [0,)[0, \infty) includes its boundary.
-10-5510-55f(x) = √x
√x, domain frozen

The filled green dot at the origin is the difference: zero is accepted, the curve genuinely starts there. Domain [0, ∞).

That inclusion is the filled green dot at the origin: the curve genuinely starts there, at an actual point, rather than falling away toward a wall it can never touch. Everything left of the dot is red; the dot itself is green.

The contrast with the logarithm is the cleanest open-versus-closed lesson in the tool: both domains are half-lines with boundary zero, and the single question "is the boundary point itself allowed?" separates [0,)[0, \infty) from (0,)(0, \infty).

Interval notation mirrors the markers exactly: square bracket = filled dot, round parenthesis = open circle.

The Reciprocal and Its Excluded Point

The reciprocal 1/x1/x accepts everything except a single number: its domain is all of R\mathbb{R} with the one point x=0x = 0 punched out.
-10-5510-55f(x) = 1/x
1/x, domain frozen

Green in both directions with one puncture: a lone open circle at x = 0, the single refused input that shapes the whole graph.

The domain bar shows green in both directions with a lone open circle at the origin — a puncture, not a wall. Unlike the half-line restrictions, almost nothing is lost: one input out of infinitely many.

But that one point carries consequences: the vertical asymptote, the split into two branches, the sign flip from -\infty to ++\infty. A single excluded input can dominate a function's entire geometry.

Shift hh and the puncture follows to x=hx = h. Every rational function's domain is built this way — the real line minus the zeros of its denominator, one open circle per zero.