Math and AI: Finding Derivatives

This program simplifies equations that you type into the textbox located at the top of the applet. It can answer any simple mathematical problems involving basic operations such as +, -, ^, etc. and also solve simple differential problems.

• All input must conform to LISP syntax. Thus incorrectly used quotes, parentheses, etc. will give off an error. If you are not familiar with LISP syntax, take a look at the examples below.
• This program will only work on one equation at a time (you should not type two equations in the input field).
• All equations must be bound with parentheses (see examples).
• All operators and operands must be spaced apart. Input like this cannot be processed: (2+3).
• The operators allowed in this program include +, -, /, *, ^, exp, and d (differentiation).
• This program can accept both prefix notation and infix notation. Prefix notation is where the operator comes first: (+ 1 (* 2 3)). This is the notation used in LISP. On the other hand, infix notation is where the operator comes in between the operands (like you are used to): (1 + (2 * 3)). Our program accepts both types of input but prints out responses in infix form.
• The operands allowed include any number and the variable X. This program will treat X like you normally would in algebra. All differentiation will be done with respect to X. This program cannot differentiate equations where X is the exponent.
• The notation used for taking the derivative of a certain equation is as follows: (d (equation)). For example, to find the derivative of (x ^ 2) you would type in (d (x ^ 2)).
• This program only allows a maximum of two operands per operator. Thus (+ 1 2) is allowed but not (+ 1 2 3). In order to place multiple operators into the equation use parentheses like this: (+ 1 (+ 2 3)).
• In some cases, this program will not simplify completely because it only simplifies statements within parentheses. Thus, this program could not simplify ((X + 2) + 1) because it takes (X + 2) as one operand and 1 as the other operand and cannot add the two together.
• This program can differentiate using the product rule, the addition rule, the constant rule, and the exponent rule.

Try these examples:

• (+ (+ 2 2) (+ 2 3))
• ((2 + 2) + (2 + 3))
• (+ (D (EXP X 3)) (D (+ (* (* 3 x) 4) 4)))
• ((D (x ^ 3)) + (D (((3 * x) * 4) + 4)))