/* MACSYMA symbolic algebra example */
/* Compute derivative and simplify */

/* Define a function */
f: x^3 + 3*x^2 - 5*x + 7;

/* Take the derivative with respect to x */
df: diff(f, x);

/* Simplify the result */
simplified: ratsimp(df);

/* Display the result */
print("Original function:", f);
print("Derivative:", df);
print("Simplified:", simplified);

/* Solve for critical points */
critical: solve(df = 0, x);
print("Critical points:", critical);
