I want to rearrange an equation of the form
a*f'[x] + b*f[x] +g[x]+h[x]==0
a*f'[x]+b*f[x] == - g[x] - h[x]
I've tried using rules but I can't arrive to something working correctly...
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
march's answer is correct but perhaps one could do this in stages to make the generality of the method for transforming algebraic equations more transparent. First step is the same:
eqn = a*f'[x] + b*f[x] + g[x] + h[x] == 0
Then use the pure function and slot to do the first algebraic step of subtracting g[x] from both sides:
eqn1 = # - g[x] & /@ eqn
Repeat for the second function:
eqn2 = # - h[x] & /@ eqn1 (* a f'(x)+b f(x)=-g(x)-h(x) *)
This produces the result and these transformations can be used to perform operations on equations that follow textbooks etc. Sorry if this is overly simplistic.