A CAS of One's Own
It's a little too late for me to use it to solve my homework problem, so I'll stick to using the Maple output generously provided by a classmate, but I've been tinkering with writing my own simple computer algebra system. (It's not interactive at all, but that could always be done later, and it's not the interesting part.)
An expression: ((a * a) + (a * a))
simplified: ((a ^ 2) * 2)
Differentiated with respect to a: (((2 * (a ^ (2 + -1))) * 2) + ((a ^ 2) * 0))
and simplified again: (4 * a)
Unfortunately, it's weakest component is still simplifying expressions1. Taking two derivatives of the expression exp(W) with respect to each other variables g and J gives:
((((((((((exp(W) * [dW / dJ]) * [dW / dJ]) + (exp(W) *
[d^2 W / dJ^2])) * [dW / dg]) + ((exp(W) * [dW / dJ]) *
[d^2 W / dJ dg])) + (((exp(W) * [dW / dJ]) * [d^2 W / dJ dg]) +
(exp(W) * [d^3 W / dJ^2 dg]))) * [dW / dg]) + ((((exp(W) *
[dW / dJ]) * [dW / dg]) + (exp(W) * [d^2 W / dJ dg])) *
[d^2 W / dJ dg])) + (((((exp(W) * [dW / dJ]) * [dW / dg]) +
(exp(W) * [d^2 W / dJ dg])) * [d^2 W / dJ dg]) + ((exp(W) *
[dW / dg]) * [d^3 W / dJ^2 dg]))) + ((((((exp(W) * [dW / dJ]) *
[dW / dJ]) + (exp(W) * [d^2 W / dJ^2])) * [d^2 W / dg^2]) +
((exp(W) * [dW / dJ]) * [d^3 W / dJ dg^2])) + (((exp(W) *
[dW / dJ]) * [d^3 W / dJ dg^2]) + (exp(W) *
[d^4 W / dJ^2 dg^2]))))
I think that there's a bug in the product simplification routine, in addition to the fact that I still need to devise an algorithm to properly combine like terms in deeply nested products. Also, the entire set of substitution routines seems to steadfastly refuse to do anything, which is a little puzzling.
-
Of the features it even has, that is. It's not even 600 lines of code yet, so one shouldn't expect too much. ↩