Re: Differencing two equations
- To: mathgroup at smc.vnet.net
- Subject: [mg131479] Re: Differencing two equations
- From: nma%12000.org at gtempaccount.com
- Date: Sun, 4 Aug 2013 05:16:44 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20130210082414.C3A5F6937@smc.vnet.net> <kfae39$m53$1@smc.vnet.net>
On Monday, February 11, 2013 3:36:41 AM UTC-6, Bob Hanlon wrote:
> eqnOperate[eqn1_, eqn2_, f_] :=
>
> Equal @@ f @@ {List @@ eqn1, List @@ eqn2};
>
> eqnOperate[a == r, b == s, Subtract]
>
>
> a - b == r - s
>
Hello;
Do you know why this case of subtracting 2 equations does not produce the expected result using your function above?
------------------------------
eqnOperate[eqn1_, eqn2_, f_] :=
Equal @@ f @@ {List @@ eqn1, List @@ eqn2};
eqn1 = 8*(-f[-h + x] + f[h + x] == 2*h*Derivative[1][f][x]);
eqn2 = -f[-2*h + x] + f[2*h + x] ==
4*h*Derivative[1][f][x] + (8/3)*h^3*Derivative[3][f][x] +
(8/15)*h^5*Derivative[5][f][x];
eqnOperate[eqn1, eqn2, Subtract]
-------------------------------------
Out[4]= 8 + f[-2*h + x] -
f[2*h + x] == (-f[-h + x] + f[h + x] == 2*h*Derivative[1][f][x]) -
4*h*Derivative[1][f][x] -
(8/3)*h^3*Derivative[3][f][x] - (8/15)*h^5*Derivative[5][f][x]
You can see the result has too many '==' inside it.
thanks,
--Nasser