HexMathv1.0.4

Function calculator with steps

This function calculator evaluates a function at a number or an expression, composes two functions and solves f(x) = k for x. Type the function and what you want, or scan the problem. HexMath returns the result and shows each substitution and simplification, including the difference quotient used in early calculus.

Loading math input...

What this page covers

  • Evaluating f(x)f(x) at a number or at an expression such as x+hx + h.
  • Composing functions: f(g(x))f(g(x)) and g(f(x))g(f(x)).
  • Solving f(x)=kf(x) = k for xx, and simplifying the difference quotient f(x+h)−f(x)h\frac{f(x + h) - f(x)}{h}.
  • Not covered here: the domain and range (see the domain and range calculator) and the inverse of a function (type the problem into the solver).

How to enter the problem

  • Type the definition first and then the question, for example f(x) = 2x^2 − 3x + 1, find f(−2).
  • Scan it. Fit the one problem in the frame.
  • Choose a photo. Several problems in one photo are solved as a list.
  • Then tap Solve.

Worked examples

Example 1: If f(x) = 2x² - 3x + 1, find f(-2).

Problem

If f(x)=2x2−3x+1\displaystyle f(x) = 2x^2 - 3x + 1, find f(−2)\displaystyle f(-2).

Answer

Verified

The answer is

f(−2)=15f(-2) = 15

Explanation

  1. Substitute with brackets
    Replace every xx by (−2)(-2)
    f(−2)=2(−2)2−3(−2)+1f(-2) = 2(-2)^2 - 3(-2) + 1
  2. Evaluate the power
    (−2)2=4(-2)^2 = 4, so the first term is 2⋅4=82 \cdot 4 = 8. The square of a negative number is positive.
  3. Evaluate the product
    −3(−2)=+6-3(-2) = +6
  4. Add up
    8+6+1=158 + 6 + 1 = 15

Example 2: Let f(x) = x² - 2x. Solve f(x) = 15.

Problem

Let f(x)=x2−2x\displaystyle f(x) = x^2 - 2x. Solve f(x)=15\displaystyle f(x) = 15.

Answer

Verified

The answer is

x=5,x=−3x = 5, x = -3

Explanation

  1. Set the function equal to 15
    x2−2x=15x^2 - 2x = 15
  2. Move everything to one side
    x2−2x−15=0x^2 - 2x - 15 = 0
  3. Factor
    (x−5)(x+3)=0(x - 5)(x + 3) = 0
  4. Solve each factor and check
    x=5x = 5 or x=−3x = -3. Check: f(5)=25−10=15f(5) = 25 - 10 = 15 and f(−3)=9+6=15f(-3) = 9 + 6 = 15.

Example 3: For f(x) = x² - 4x, simplify (f(x + h) - f(x))/h.

Problem

For f(x)=x2−4x\displaystyle f(x) = x^2 - 4x, simplify f(x+h)−f(x)h\displaystyle \dfrac{f(x + h) - f(x)}{h}.

Answer

Verified

The answer is

2x+h−42x + h - 4

Explanation

  1. Evaluate f(x+h)f(x + h)
    (x+h)2−4(x+h)=x2+2xh+h2−4x−4h(x + h)^2 - 4(x + h) = x^2 + 2xh + h^2 - 4x - 4h
  2. Subtract f(x)f(x)
    x2+2xh+h2−4x−4h−(x2−4x)=2xh+h2−4hx^2 + 2xh + h^2 - 4x - 4h - (x^2 - 4x) = 2xh + h^2 - 4h
  3. Divide by hh
    2xh+h2−4hh=2x+h−4\frac{2xh + h^2 - 4h}{h} = 2x + h - 4, for h≠0h \neq 0.

Common mistakes

  • Squaring a negative input without brackets. f(−2)f(-2) needs 2(−2)2=82(-2)^2 = 8; reading it as 2⋅(−22)=−82 \cdot (-2^2) = -8 gives −1-1 instead of 15.
  • Reading f(g(x))f(g(x)) as the product f(x)⋅g(x)f(x) \cdot g(x). Composition puts g(x)g(x) inside ff.
  • Composing in the wrong order. g(f(x))=3x2+1g(f(x)) = 3x^2 + 1, a different function from f(g(x))f(g(x)).
  • Subtracting only the first term of f(x)f(x) in a difference quotient. The bracket in −(x2−4x)-(x^2 - 4x) changes both signs.

Checks, assumptions and limits

  • Test a composition at one number. With x=1x = 1: g(1)=1g(1) = 1 and f(1)=2f(1) = 2, and 9−12+5=29 - 12 + 5 = 2 too.
  • Functions here are real-valued; an input outside the domain has no output.
  • In a difference quotient hh is not zero, which is what allows dividing by hh.
  • HexMath can make mistakes. Double check important steps.

Frequently asked questions

Evaluate it at a number, find a composition such as f(g(x)), solve f(x) = k, or simplify a difference quotient. Write the definition first, then the question.

Yes. Define f and g in the same problem, for example f(x) = x^2 + 1 and g(x) = 3x − 2, then ask for f(g(x)).

Yes. The first step writes the input in place of x, in brackets, before any arithmetic. That is where most sign errors start.

Yes. Give f(x) and ask for the difference quotient. The steps substitute x + h, subtract f(x) and simplify the fraction until the h in the denominator cancels.

Ready to solve your next math problem?

Create a free account for 3 math questions a day in your browser. No card.

Get HexMath on your phone

The same solver and camera scan on iPhone and Android.

Last updated: · HexMath