Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So you want to know if a specific mathematical expression (like (x1)2(x22x)) is a constant. Just check whether its derivative is zero:

sage: var('C, C2')
sage: diff(((x-1)^2+C) - (x^2-2*x+C2), x)
0
sage: bool(diff(((x-1)^2+C) - (x^2-2*x+C2), x) == 0)
True