You are viewing this question as it will appear in the manual grading interface. Return to the normal view when you are done.

Element pl-symbolic-input: Input of symbolic answers

An example in which complex numbers are not allowed (allow-complex="false")

Suppose $$y = a x + b.$$ Assuming that $a \neq 0$, solve for $x$.

The attribute initial-value pre-fills the input the first time it is rendered so students can begin from a suggested expression.

$x=$
An example in which complex numbers are allowed (allow-complex="true")

Write an expression for the complex number $z$ whose argument is $a$ (in radians) and whose modulus is $m$.

$z=$
An example in which the correct answer is specified as a string in server.py

Write an expression for the current $I$ in a resistor if the voltage is $V$ and the resistance is $R$.

$I=$
An example in which we specify a different imaginary unit for display (imaginary-unit-for-display="j")

Write an expression for the complex number $c$ whose real part is $a$ and whose imaginary part is $b$.

$c=$
An example in which we specify the use of ln rather than log for display (display-log-as-ln="true")

Write an expression for the derivative of $ln(x)*x$.

$\dfrac{d}{dx} ln(x)*x =$
An example that uses the formula editor input

Submit $\displaystyle {\rm test}\left(\sqrt{\frac{e^x}{x^2}}\right)$

$y = $
An example that uses the formula editor with an initial value

Suppose $$y = a x + b.$$ Assuming that $a \neq 0$, solve for $x$.

The initial-value attribute works with the formula editor. The sympy expression is automatically converted to LaTeX for the editor display.

$x=$ \frac{- b + y}{a}
An example in which we disable the display of simplified student submissions (display-simplified-expression="false")

Write the expression $sin(atan(x))$.

Note that this expression will be simplified to $\frac{x}{\sqrt{x^2+1}}$ if display-simplified-expression is not disabled.

$y =$
An example in which we change display attributes

The size of the input box can be set with the attribute size, and the attribute show-help-text="false" removes the button for the help popup. The attribute placeholder can be used to set the placeholder text. This box below has size=5 instead of the default size=35.

Write an expression for the first derivative of $\frac{1}{2} x^2$.

$\dfrac{d}{dx} \frac{1}{2}x^2 =$
An example in which we allow a blank answer

The allow-blank attribute allows an expression to be left blank by the user and still be considered valid. By default a blank expression is equivalent to the expression 0, unless the blank-value is used. The placeholder attribute allows setting custom placeholder text.

Simplify the expression $x^2+x+1$, or leave it blank if the expression cannot be simplified further.

An example in which a blank answer is the only correct answer

When allow-blank="true" is set, truly empty answers are also supported by setting blank-value="" (and potentially correct-answer="").

Find a value for $x \in \mathbb{R}$ so that $x^2 = -1$. If there is no solution, leave the answer blank.

An example where we use assumptions

Sometimes, certain expressions can only be treated as equivalent by sympy if additional assumptions are made. For example, consider that $\sqrt{B^2} = B$ is only true if $B \geq 0$. To use these, assumptions must be set in the server.py file when variables are declared.

Submit an expression equivalent to $\sqrt{B^2}$ when assuming $B > 0$.

Another example where we use assumptions

Simplify $|C|$ assuming that $C \leq 0$.

An example in which trig functions are not allowed (allow-trig-functions="false")

What is the value of $\cos(\pi) * x$?

$\cos(\pi) * x = $
Example using custom functions

Submit $f(x) + beef(\alpha)$, where $\alpha$ should be spelled out as alpha in the submission.

Another example with custom functions

Submit $beef(y) + the(y)$. We set show-score="false" to hide the score badge and suffix="$= \text{where?}$" to set the suffix.

$= \text{where?}$
An example with nested absolute value expressions

This example demonstrates handling of nested absolute value expressions. Submit the expression $|x+|-x+1+2+3+4||$.

Note: This tests the symbolic input's ability to handle complex nested absolute value expressions with multiple terms.

$y =$
An example that times-out.

This demonstrates a submission for which sympy takes an indeterminate amount of time to solve, when the answer is wrong.

Submit below $\exp(sin(n)) \cdot (1+ sin(n)^2)^{125}$. The actual answer is $\exp(\sin(n))*(1 + \sin(n)^{10})^{5}$, but the submission will timeout.



An example in which interval notation is allowed (allow-sets="true")

Consider $f(x) = x^{-2} - 4$. Using intervals and set unions, find $\{ x | f(x) \leq 0 \}$.

Correct answer: $ (-\infty, -1/2] \cup [1/2, \infty) $
An example in which set notation is allowed (allow-sets="true")

For which values of $\theta \in [0, 2\pi)$ does $\sin(\theta) = \cos(\theta)$? Express your answer as a set.

Correct answer: $\{\pi/4, 5\pi/4\}$ $\theta \in$
Another example of set notation

Set theory defines numerals inductively: $0 = \{ \}$, and $n + 1 = \{ 0, 1, ..., n \}$ where each number is written in set-numeral form. What is the set numeral for 2? (Don't use any numbers!)

Correct answer: $\left\{ \{\}, \left\{ \{\} \right\} \right\}$ $2 =$

Correct answer

An example in which complex numbers are not allowed (allow-complex="false")
$x=$ $\frac{- b + y}{a}$
An example in which complex numbers are allowed (allow-complex="true")
$z=$ $m \left(i \sin{\left(a \right)} + \cos{\left(a \right)}\right)$
An example in which the correct answer is specified as a string in server.py
$I=$ $\frac{V}{R}$
An example in which we specify a different imaginary unit for display (imaginary-unit-for-display="j")
$c=$ $a + b j$
An example in which we specify the use of ln rather than log for display (display-log-as-ln="true")
$\dfrac{d}{dx} ln(x)*x =$ $\ln{\left(x \right)} + 1$
An example that uses the formula editor input
$y = $ $\operatorname{test}{\left(\sqrt{\frac{e^{x}}{x^{2}}} \right)}$
An example that uses the formula editor with an initial value
$x=$ $\frac{- b + y}{a}$
An example in which we disable the display of simplified student submissions (display-simplified-expression="false")
$y =$ $\sin{\left(\operatorname{atan}{\left(x \right)} \right)}$
An example in which we change display attributes
$\dfrac{d}{dx} \frac{1}{2}x^2 =$ $x$
An example in which we allow a blank answer
$x^{2} + x + 1$
An example in which a blank answer is the only correct answer
$\mathtt{\text{}}$
An example where we use assumptions
$B$
Another example where we use assumptions
$- C$
An example in which trig functions are not allowed (allow-trig-functions="false")
$\cos(\pi) * x = $ $- x$
Example using custom functions
$\operatorname{beef}{\left(\alpha \right)} + f{\left(x \right)}$
Another example with custom functions
$\operatorname{beef}{\left(y \right)} + \operatorname{the}{\left(y \right)}$ $= \text{where?}$
An example with nested absolute value expressions
$y =$ $\left|{x + \left|{x - 10}\right|}\right|$
An example that times-out.
$\left(\sin^{10}{\left(n \right)} + 1\right)^{5} e^{\sin{\left(n \right)}}$

An example in which interval notation is allowed (allow-sets="true")
$\left(-\infty, - \frac{1}{2}\right] \cup \left[\frac{1}{2}, \infty\right)$
An example in which set notation is allowed (allow-sets="true")
$\theta \in$ $\left\{\frac{\pi}{4}, \frac{5 \pi}{4}\right\}$
Another example of set notation
$2 =$ $\left\{\emptyset, \left\{\emptyset\right\}\right\}$

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Element pl-symbolic-input: Input of symbolic answers

Variant

Started at:
2026-08-04 22:49:00 (CDT)
Duration:
0s
Show/Hide answer
{
  "I": "V / R",
  "c": {
    "_type": "sympy",
    "_value": "_ImaginaryUnit*b + a",
    "_variables": [
      "a",
      "b"
    ],
    "_assumptions": {
      "a": {
        "commutative": true
      },
      "b": {
        "commutative": true
      }
    },
    "_custom_functions": []
  },
  "x": {
    "_type": "sympy",
    "_value": "(-b + y)/a",
    "_variables": [
      "a",
      "y",
      "b"
    ],
    "_assumptions": {
      "a": {
        "commutative": true
      },
      "b": {
        "commutative": true
      },
      "y": {
        "commutative": true
      }
    },
    "_custom_functions": []
  },
  "z": {
    "_type": "sympy",
    "_value": "m*(_ImaginaryUnit*sin(a) + cos(a))",
    "_variables": [
      "a",
      "m"
    ],
    "_assumptions": {
      "a": {
        "commutative": true
      },
      "m": {
        "commutative": true
      }
    },
    "_custom_functions": []
  },
  "dx": "x",
  "lnx": {
    "_type": "sympy",
    "_value": "log(x) + 1",
    "_variables": [
      "x"
    ],
    "_assumptions": {
      "x": {
        "commutative": true
      }
    },
    "_custom_functions": []
  },
  "no_trig": "-x",
  "timeout": "exp(sin(n))*(1 + sin(n)**10)**5",
  "simplify": {
    "_type": "sympy",
    "_value": "x**2 + x + 1",
    "_variables": [
      "x"
    ],
    "_assumptions": {
      "x": {
        "commutative": true
      }
    },
    "_custom_functions": []
  },
  "nested_abs": {
    "_type": "sympy",
    "_value": "Abs(x + Abs(x - 10))",
    "_variables": [
      "x"
    ],
    "_assumptions": {
      "x": {
        "commutative": true
      }
    },
    "_custom_functions": []
  },
  "nosimplify": "sin(atan(x))",
  "assumptions": {
    "_type": "sympy",
    "_value": "B",
    "_variables": [
      "B"
    ],
    "_assumptions": {
      "B": {
        "real": true,
        "zero": false,
        "finite": true,
        "complex": true,
        "nonzero": true,
        "infinite": false,
        "negative": false,
        "positive": true,
        "hermitian": true,
        "imaginary": false,
        "commutative": true,
        "nonnegative": true,
        "nonpositive": false,
        "extended_real": true,
        "extended_nonzero": true,
        "extended_negative": false,
        "extended_positive": true,
        "extended_nonnegative": true,
        "extended_nonpositive": false
      }
    },
    "_custom_functions": []
  },
  "set_notation": "{pi/4, 5pi/4}",
  "set_numerals": "{ {}, { {} } }",
  "assumptions_2": {
    "_type": "sympy",
    "_value": "-C",
    "_variables": [
      "C"
    ],
    "_assumptions": {
      "C": {
        "real": true,
        "prime": false,
        "finite": true,
        "complex": true,
        "infinite": false,
        "positive": false,
        "composite": false,
        "hermitian": true,
        "imaginary": false,
        "commutative": true,
        "nonpositive": true,
        "extended_real": true,
        "extended_positive": false,
        "extended_nonpositive": true
      }
    },
    "_custom_functions": []
  },
  "formula_editor": {
    "_type": "sympy",
    "_value": "test(sqrt(_Exp1**x/x**2))",
    "_variables": [
      "x"
    ],
    "_assumptions": {
      "x": {
        "commutative": true
      }
    },
    "_custom_functions": [
      "test"
    ]
  },
  "simplify_blank": "",
  "custom_function": "f(x) + beef(alpha)",
  "custom_function_2": {
    "_type": "sympy",
    "_value": "beef(y) + the(y)",
    "_variables": [
      "y"
    ],
    "_assumptions": {
      "y": {
        "commutative": true
      }
    },
    "_custom_functions": [
      "the",
      "beef"
    ]
  },
  "interval_notation": "(-infty, -1/2] U [1/2, infty)",
  "formula_editor_initial": {
    "_type": "sympy",
    "_value": "(-b + y)/a",
    "_variables": [
      "a",
      "y",
      "b"
    ],
    "_assumptions": {
      "a": {
        "commutative": true
      },
      "b": {
        "commutative": true
      },
      "y": {
        "commutative": true
      }
    },
    "_custom_functions": []
  }
}
History
dec frac
rad deg