Math solvers

To help students, teachers, and others with math problems, you can use structured data to indicate the type of math problems and step-by-step walkthroughs for specific math problems. Here's an example of how math solvers may look in Google Search results (the appearance is subject to change):

Example of a math solvers rich result

To make sure users get the most out of your math solver's structured data, mark up both the home page and (if possible) solution pages for the specific mathematical expressions. With home page markup, Google can surface important information, such as whether the math solver contains a step-by-step explanation of the solution, or if the math solver can solve geometry problems.

Home page markup can also enable showing more detailed info about the math solver. For example, your math solver may accept generic input from users, but have distinct capabilities outlined on your site. For example, when users see that a math solver can solve polynomial equations, they may feel more comfortable clicking through to your math solver for queries like "x^2 - 3x = 0".

To enable step-by-step previews of the math solver, you can add server-side generated solution page markup to the specific problems. The step-by-step previews show users that your math solver is capable of solving their exact problem.

How to add structured data

Structured data is a standardized format for providing information about a page and classifying the page content. If you're new to structured data, you can learn more about how structured data works.

Here's an overview of how to build, test, and release structured data. For a step-by-step guide on how to add structured data to a web page, check out the structured data codelab.

  1. Add the required properties. For information about where to put structured data on the page, watch JSON-LD structured data: Where to insert on the page.
  2. Follow the guidelines.
  3. Validate your code using the Rich Results Test.
  4. Deploy a few pages that include your structured data and use the URL Inspection tool to test how Google sees the page. Be sure that your page is accessible to Google and not blocked by a robots.txt file, the noindex tag, or login requirements. If the page looks okay, you can ask Google to recrawl your URLs.
  5. To keep Google informed of future changes, we recommend that you submit a sitemap. You can automate this with the Search Console Sitemap API.

Examples

Home page with one solver action

Here's an example of a math solver home page that has one solver action that can solve polynomial equations and derivative problems.


<html>
<head>
<title>An awesome math solver</title>
</head>
<body>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": ["MathSolver", "LearningResource"],
  "name": "An awesome math solver",
  "url": "https://www.mathdomain.com/",
  "usageInfo": "https://www.mathdomain.com/privacy",
  "potentialAction": [{
    "@type": "SolveMathAction",
    "target": "https://mathdomain.com/solve?q={math_expression_string}",
    "mathExpression-input": "required name=math_expression_string",
    "eduQuestionType": ["Polynomial Equation","Derivative"]
   }],
  "learningResourceType": "Math solver"
}
</script>
</body>
</html>

Home page with two solver actions

Here's an example of a math solver home page that has two solver endpoints: one endpoint can solve polynomial equations and the other endpoint can solve trigonometric equations.


<html>
<head>
<title>An awesome math solver</title>
</head>
<body>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": ["MathSolver", "LearningResource"],
  "name": "An awesome math solver",
  "url": "https://www.mathdomain.com/",
  "usageInfo": "https://www.mathdomain.com/privacy",
  "potentialAction": [{
     "@type": "SolveMathAction",
     "target": "https://mathdomain.com/solve?q={math_expression_string}",
     "mathExpression-input": "required name=math_expression_string",
     "eduQuestionType": "Polynomial Equation"
   },
   {
     "@type": "SolveMathAction",
     "target": "https://mathdomain.com/trig?q={math_expression_string}",
     "mathExpression-input": "required name=math_expression_string",
     "eduQuestionType": "Trigonometric Equation"
   }],
  "learningResourceType": "Math solver"
}
</script>
</body>
</html>

Solution page

Here's an example of a solution page with two different step-by-step walkthroughs to a problem.


<html>
<head>
<title>An awesome math solver</title>
</head>
<body>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": ["MathSolver", "LearningResource"],
  "name": "An awesome math solver",
  "url": "https://www.mathdomain.com/solve?q=x^2-3x=0",
  "usageInfo": "https://www.mathdomain.com/privacy",
  "assesses": "Polynomial Equation",
  "hasPart": {
    "@context": "https://schema.org",
    "@type": "HowTo",
    "url": "https://www.mathdomain.com/solve?q=x^2-3x=0",
    "name": "$$ x^2 -3x = 0 $$",
    "about": {
      "@type": "Thing",
      "name": "$$ x^2 - 3x = 0 $$"
    },
    "yield": "$$ x = 3 \\ x = 0 $$",
    "tool": [
      {
        "@type": "HowToTool",
        "name": "Quadratic Formula"
      },
      {
        "@type": "HowToTool",
        "name": "Common Factoring"
      }
    ],
    "step": [{
      "@type": "HowToSection",
      "name": "Quadratic Formula",
      "position": "1",
      "numberOfItems": "5",
      "itemListElement": [{
          "@type": "HowToStep",
          "position": "1",
          "text": "Use the quadratic formula <br> $$ x=\\frac{-({\\color&#123;#e8710a}{-3}}) \\pm \\sqrt{({\\color&#123;#e8710a}{-3}})^{2}-4 \\cdot {\\color&#123;#c92786}{1}} \\cdot {\\color&#123;#129eaf}{0}}}}{2 \\cdot {\\color&#123;#c92786}{1}}} $$"
        },
        {
          "@type": "HowToStep",
          "position": "2",
          "text": "Simplify the quadratic formula <br> $$ x=\\frac{3 \\pm 3}{2} $$"
        }
      ]
    },
    {
      "@type": "HowToSection",
      "name": "Common factoring",
      "position": "2",
      "numberOfItems": "4",
      "itemListElement": [
        {
          "@type": "HowToStep",
          "position": "1",
          "text": "Use the sum product pattern"
        },
        {
          "@type": "HowToStep",
          "position": "2",
          "text": "Write the equation in factored form <br> $$ (x-3)(x+0)=0 $$"
        }
      ]
    }
  ]
},
  "learningResourceType": "Math solver"
}
</script>
</body>
</html>

Guidelines

For your page to be eligible for math solver rich results, you must follow these guidelines:

Guidelines for solution pages

Solution page markup enables previews of step-by-step solutions so that users can feel confident their problems can be solved on your site. Due to the nature of math, there are additional requirements when marking up solution pages.

  • Solution page markup must be server-side generated and not dynamically injected into the page after the initial page load.
  • Solution page markup must be in JSON-LD format.

Structured data type definitions

You must include the required properties for your content to be eligible for display as a rich result. You can also include the recommended properties to add more information to your structured data, which could provide a better user experience.

MathSolver

A MathSolver is a tool that assists students, teachers, and others with math problems by laying out step-by-step solutions. Use MathSolver structured data on both the home page and solution page.

The full definition of MathSolver is available at schema.org/MathSolver.

Required properties
potentialAction

SolveMathAction

The action that leads to a mathematical explanation (for example, step-by-step solution or graph) of a math expression.

{
"@type": "MathSolver",
"potentialAction": [{
  "@type": "SolveMathAction",
  "target": "https://mathdomain.com/solve?q={math_expression_string}",
  "mathExpression-input": "required name=math_expression_string"
  "eduQuestionType": "Polynomial Equation"
  }]
}
potentialAction.mathExpression-input

Text

A mathematical expression (for example: x^2-3x=0) that may be simplified, transformed, or solved for a specific variable. This can take many formats (for example: LaTeX, Ascii-Math, or mathematical expressions that you can write with a keyboard).

url

URL

The URL of the MathSolver.

usageInfo

URL

The privacy policy for your math problem solving site.

{
  "@type": "MathSolver",
  "usageInfo": "https://www.mathdomain.com/privacy"
}
potentialAction.target

EntryPoint

The URL target entrypoint for an action. The potentialAction.target property accepts a string to represent the math expression that's being solved by the action.

{
"@type": "MathSolver",
"potentialAction": [{
  "@type": "SolveMathAction",
  "target": "https://mathdomain.com/solve?q={math_expression_string}"
  }]
}
Recommended properties
assesses

Text list of Problem Type Definitions

The problem type(s) that are solved with the HowTo. Use the assesses property if you're using HowTo markup in addition to MathSolver markup.

{
  "@type": "MathSolver",
  "assesses": "Polynomial Equation"
}
potentialAction.eduQuestionType

Text list of Problem Type Definitions

The problem type(s) that are capable of being solved by the potentialAction.target property.

{
  "@type": "SolveMathAction",
  "eduQuestionType": "Polynomial Equation"
}

LearningResource

A LearningResource indicates that the subject of the markup is a resource that assists students, teachers, and others with educational learning. Use LearningResource on both the home page and solution pages.

The full definition of LearningResource is available at schema.org/LearningResource.

Required properties
learningResourceType

Text

The type of this learning resource. Use this fixed value: Math Solver.

{
  "@type": ["MathSolver", "LearningResource"],
  "learningResourceType": "Math Solver"
}

HowTo

Mark up the specific steps to solving a problem on both the home page and solution pages with the MathSolver type. Refer to the example for how to embed the HowTo type in the MathSolver type.

The full definition of HowTo is available at schema.org/HowTo.

Required properties
about.name

Thing

The math problem, equation, or expression that's being solved or walked through. Format the value as a mathematical expression (in the following example, the value is enclosed in $$.) Learn more about encoding math problems in HTML.

{
  "about": {
    "@type": "Thing",
    "name": "$$ x^2 - 3x = 0 $$"
  }
}
step

List of HowToSection

A single step or a HowToSection type.

If there is more than one method to solve a problem, represent each method with a HowToSection property. For each tool property listed, also include a HowToSection property.

Some problem types might be answered with something more like a list of properties rather than a step by step walkthrough. An example might be a function f(x) = (x - 5)(x + 5). A student may interested in the simplification, y-intercept, x-intercept, derivative, or other properties of this function. We ask that you place the highest emphasis on simplification, as it is something that can be answered with a step by step walkthrough rather than only an answer.

step.itemListElement

List of HowToStep

A list of steps that indicate how to solve the problem with the method specified by the HowToSection property's name.

{
  "@type": "HowToSection",
  "name": "Quadratic Formula",
  "position": "1",
  "itemListElement": []
}
step.itemListElement

HowToStep

A HowToStep describes a discrete action taken to solve a problem.

{
  "@type": "HowToStep",
  "position": "3",
  "text": "Set each factor equal to zero <br>$$ x - 3 = 0 $$<br>$$ x + 0 = 0 $$"
  ]
}
step.itemListElement.position

Text

The relative ordering of the HowToStep. The position property is how Google understands what order each HowToStep property should be taken to solve the problem.

{
  "@type": "HowToStep",
  "position": "3",
  "itemListElement": []
}
step.name

Text

The method that's being used to solve the problem. Use the same value as the tool value.

{
  "@type": "HowToSection",
  "name": "Quadratic Formula"
}
step.numberOfItems

Integer

The number of steps in the solution method that's described by the HowToSection.

{
  "@type": "HowToSection",
  "numberOfItems": "6"
}
step.position

Text

The relative ordering of the HowToSection. This is useful if there is more than one method to solve a problem.

{
  "@type": "HowToSection",
  "position": "1"
}
tool

HowToTool

The method(s) that are being used to solve the math problem. Each method name must be one of the following values:

  • Quadratic Formula: Solving quadratic equations with quadratic formula.
  • Factoring: Solving polynomial equations by factoring/grouping terms.
  • Completing the Square: Solving quadratic equations by completing the square.
  • Graphing: Displaying various equations or expressions on a two or more dimensional plane.
  • Row Reduction: Simplifying a matrix into its row reduced echelon form.
  • Solve by Substitution: Solving a matrix or system of equations by substitution.
  • Solve by Elimination: Solving a matrix or system of equations by elimination.
  • Cramer's Rule: Solving a matrix or system of equations with Cramer's rule.
{
  "tool": [
    {
      "@type": "HowToTool",
      "name": "Quadratic Formula"
    },
    {
      "@type": "HowToTool",
      "name": "Common Factoring"
    }
  ]
}
url

URL

The URL of the page that provides the solution or walkthrough of the math problem.

yield

Text

The answer to the math problem. If the answer is a mathematical expression, format the value as math. Learn more about encoding math problems in HTML.

{
  "yield": "$$ x = 0 \\ x = 3 $$",
}

Problem Type Definitions

Use the following list of problem types as either the eduQuestionType for a MathSolver.potentialAction or for the assesses field of a MathSolver when the MathSolver is accompanying a HowTo that walks through a specific math problem.

Example problem types (this isn't an exhaustive list)
Absolute Value Equation

Absolute value equations. For example: |x - 5| = 9

Algebra

A generic problem type that can be placed with other problem type. For example: polynomial equations, exponential equations, and radical expressions.

Arc Length

Arc length problems. For example: Determine the length of x = 4 (3 + y)^2, 1 < y < 4.

Biquadratic Equation

Biquadratic equations. For example: x^4 - x^2 - 2 = 0.

Calculus

A generic problem type that can be placed with other problem types. For example: integrals, derivatives, and differential equations.

Characteristic Polynomial

Find the characteristic polynomial of {{1,2,5}, {3,-1,1}, {1,2,3}}.

Circle

Circle related problems. For example: Find the radius of x^2 + y^2 = 3.

Derivative

Derivative of 5x^4 + 2x^3 + 4x - 2.

Differential Equation

Differential equation problems. For example: y+dy/dx=5x.

Distance

Distance problems. For example: Find the distance between (6,-1) and (-3,2).

Ellipse

Ellipse problems. For example: Find the x and y intercepts of 9x^2 + 4y^2 = 36.

Exponential Equation

Exponential equations. For example: 7^x = 9.

Function

Polynomial simplifications. For example: (x-5)^2 * (x+5)^2.

Function Composition

f(g(x)) when f(x)=x^2-2x, g(x)=2x-2

Geometry

A generic problem type that can be placed with other problem types. For example: circle, ellipse, parabola, slope.

Hyperbola

Hyperbola problems. For example: Find the x-intercept of (x^2)/4 - (y^2)/5 = 1.

Inflection Point

Find the inflection point of f(x) = 1/2x^4 +x^3 - 6x^2.

Integral

Integral of sqrt (x^2 - y^2).

Intercept

Line intercept problems. For example: Find the x-intercept of the line y = 10x - 5.

Line Equation

Line equation problems. For example: Find the equation of a line with points (-7,-4) and (-2,-6).

Linear Algebra

A generic problem type that can be placed with other problem types. For example: matrix and characteristic polynomial.

Linear Equation

Linear equations. For example: 4x - 3 = 2x + 9.

Linear Inequality

Linear inequalities. For example: 5x - 6 > 3x - 8.

Logarithmic Equation

Logarithmic equations. For example: log(x) = log(100).

Logarithmic Inequality

Logarithmic inequalities. For example: log(x) > log(100).

Matrix

{{1,2,5}, {3,-1,1}, {1,2,3}} row reduce

Midpoint

Midpoint problems. For example: find the midpoint between (-3, 7) and (5, -2).

Parabola

Parabola problems. For example: Find the vertex of y2 - 4x - 4y = 0.

Parallel

Parallel line problems. For example: Are the two lines parallel (y = 10x + 5, y = 20x + 10)?

Perpendicular

Perpendicular problems. For example: Are the two lines perpendicular (y = 10x + 5, y = 20x + 10)?

Polynomial Equation

Polynomial equations. For example: x^5 - 3x = 0.

Polynomial Expression

Polynomial expressions. For example: (x - 5)^4 * (x + 5)^2.

Polynomial Inequality

Polynomial inequalities. For example: x^4 - x^2 - 6 > x^3 - 3x^2.

Quadratic Equation

Quadratic equations. For example: x^2 - 3x - 4 = 0.

Quadratic Expression

Quadratic expressions. For example: x^2 - 3x - 2.

Quadratic Inequality

Quadratic inequalities. For example: x^2 - x - 6 > x^2 - 3x.

Radical Equation

Radical equations. For example: sqrt(x) - x = 0.

Radical Inequality

Radical inequalities. For example: sqrt(x) - x > 0.

Rational Equation

Rational equations. For example: 5/(x - 3) = 2/(x - 1).

Rational Expression

Rational expressions. For example: 1/(x^3 + 4x^2 + 5x + 2).

Rational Inequality

Rational inequalities. For example: 5/(x - 3) > 2/(x - 1).

Slope

Slope problems. For example: Find the slope of y = 10x + 5.

Trigonometry

Solve sin(t) + cos(t) = 1.

Encoding math problem HowTo in HTML

Google Search supports HTML when encoding HowTo structured data that additionally has the MathSolver type. We restrict the set of constructs to the following:

  • Bold
  • Formulas in LaTex
  • Headers
  • Italic
  • Line breaks
  • Lists (ordered and unordered)
  • Paragraphs

CSS and Javascript are ignored. All other constructs are ignored and shown as plain text.

How to specify the format

To specify which encoding format you're using, use the encodingFormat property and set the value to "text/html" for HTML.

Math expressions

Math expressions are supported in the LaTex format. Use $$ to render math properly within the text:

"<p>You can solve $$ x^2 - 25x = 0 $$ by factoring. <br>$$ (x-5)(x+5) $$</p>"