Say I have two functions:
f[a_,b_]:=a + b
g[c_,d_,e_]:=c + d - e
And I define a third function:
h[u_,v_,w_,x_]:=f[u,v]+g[w,x,u]
It's clear (to me, a human, at least) that h doesn't depend on u, but Mathematica still requires this extra argument to define h without trickery. This is a simple situation where I could replace the occurrences of u with something non-divergent, like 1. But for more complicated cases, such a choice could lead to unwanted (and essentially artificial) divergences. Is there a Correct Way (TM) to do this kind of functional definition, or is the general case really impossible for a CAS like Mathematica?
You could define your function using
Setrather thanSetDelayedand useSimplifyorFullSimplifyto cancel what Mathematica automatically can. I useModuleto avoid collisions with global symbols.Now the definition of
hreads: