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 ($\mathbb{R}$) — Identity, Linear (2x), Quadratic, Cubic, Exponential, Sine, Cosine, Absolute. All accept every real number as input.
Restricted — Logarithmic (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:

$a$ — vertical scale. Multiplies the output by aa.
$k$ — vertical shift. Adds kk to the output.
$b$ — horizontal scale. Multiplies the input by bb.
$h$ — horizontal 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.

Related Concepts and Tools

Range of a Function — the partner concept showing which outputs the function can produce. Use the companion range visualizer to see how the mirror rule works — only aa and kk (not bb and hh) affect the range.

Functions — general theory of functions, including formal definitions of domain, range, and image.

Function Transformations — visualizer for aa, kk, bb, hh alone, useful for separating the effects of each parameter before adding the domain analysis on top.

Functions Families Gallery — gallery of the same eleven base functions plotted side by side, useful as a prerequisite for understanding what each curve looks like.

Inverse Functions — visualizer for reflecting a function across y=xy = x. The domain of ff becomes the range of f1f^{-1}, a fundamental duality made concrete by the domain and inverse tools together.

Asymptotes — vertical asymptotes correspond to excluded values in the domain (like x=0x = 0 for the reciprocal). The visualizer's red × marker is one geometric expression of this idea.

Limits and Continuity — the open/closed endpoint distinction shown in the visualizer is foundational for continuity at boundary points and for one-sided limits.