Check if two functions are equal

479 Views Asked by At

I have these two functions and I wan't to check if they're the same. I know they're identical but is it possible to use maple to check it?

I already tried evalb & verify('relation') with no luck.

Maple

2

There are 2 best solutions below

2
On

They are the same.

$$-\frac{\ln(2)}{10} - \frac{\ln(5)}{10} = -\frac{\ln(2) + \ln(5)}{10} = -\frac{\ln(10)}{10}$$

as per the $\ln(ab)=\ln(a) + \ln(b)$, for $a,b > 0$ rule. This shows the 'initial' parts of each formula are the same.

We also have $$\frac{\ln\left(-\frac1{t^3+c+2t}\right)}{10} = \frac{-\ln(-(t^3+c+2t))}{10} = \frac{-\ln(-t^3-c-2t)}{10}$$

as per the similar $\ln\left(\frac1x\right) = - \ln (x)$ rule. The right side of this differs from what Maple shows only by the name of the constant: "c" vs. "_CI".

0
On

Taking _C1=c then they are the same if t^3+c+2*t < 0, and differ by -I*Pi/5 if t^3+c+2*t > 0.

restart;
raw1:=solve(-1/(10*exp(10*y))=t^3+2*t+c,y):
res1:=simplify(raw1);

                  1          1          1    /       1      \
        res1 := - -- ln(2) - -- ln(5) + -- ln|- ------------|
                  10         10         10   |   3          |
                                             \  t  + c + 2 t/

with(DEtools):
ode:=diff(y(t),t)=exp(10*y(t))*(3*t^2+2):
raw2:=simplify(rhs(dsolve(ode))):
res2:=simplify(raw2,ln);

                 1          1          1    /  3            \
       res2 := - -- ln(2) - -- ln(5) - -- ln\-t  - _C1 - 2 t/
                 10         10         10                    

Now let's simplify the difference under the assumption that the unknowns (c and t) are real. We'll substitute _C1=c into res2.

simplify(evalc(subs(_C1=c,res2) - res1)) assuming real;

                  1    /          / 3          \\   
                 --- I \1 + signum\t  + c + 2 t// Pi
                  10                                

Another way to see that is by re-expressing both, separately,

evalc(res1 + (ln(2)+ln(5))/10):
simplify(simplify(combine(%)),size) assuming real;

    1    /| 3          |\   1         1             / 3          \
  - -- ln\|t  + c + 2 t|/ + -- I Pi + -- I Pi signum\t  + c + 2 t/
    10                      20        20                          

evalc(subs(_C1=c,res2) + (ln(2)+ln(5))/10):
simplify(simplify(combine(%)),size) assuming real;

    1    /| 3          |\   1         1             / 3          \
  - -- ln\|t  + c + 2 t|/ - -- I Pi - -- I Pi signum\t  + c + 2 t/
    10                      20        20                          

We saw the signum(t^3+c+2*t) above. We can simplify under assumptions, separately, that t^3+c+2*t is positive and negative.

simplify(evalc(subs(_C1=c,res2) - res1)) assuming t^3+c+2*t>0;

                                1     
                               -- I Pi
                                5     

simplify(evalc(subs(_C1=c,res2) - res1)) assuming t^3+c+2*t<0;

                                  0

Let's check with a particular set of values, for fun,

simplify(eval(res1, [t=1,c=-3+exp(1)]));

                  1          1          1    1      
                - -- ln(2) - -- ln(5) - -- + -- I Pi
                  10         10         10   10     

simplify(eval(res2, [t=1,_C1=-3+exp(1)]));

                  1          1          1    1      
                - -- ln(2) - -- ln(5) - -- - -- I Pi
                  10         10         10   10     

eval(t^3+c+2*t, [t=1,c=-3+exp(1)]); # greater than zero

                               exp(1)

Let's take c = -3 = _C1 and plot the real and imaginary parts of both expressions. We see a difference in the jump discontinuity of the imaginary component, at t=1.

plot([Re,Im](eval(res1, [c=-3])), t=0..2,
     thickness=3, color=[red,green],
     view=-0.5..0.5, size=[500,200]);

enter image description here

plot([Re,Im](eval(res2, [_C1=-3])), t=0..2,
     thickness=3, color=[red,green],
     view=-0.5..0.5, size=[500,200]);

enter image description here

We can show that the discontinuity above occurs at t=1, by substituting c=-3 into a real solution of t^3+c+2*t.

map(u->(rationalize(evalc(u))),[solve(t^3+c+2*t,{t})][1]) assuming c::real:

lprint(%);

  {t = (1/6912)*((-108*c+12*(81*c^2+96)^(1/2))^(2/3)-24)
       *(-108*c+12*(81*c^2+96)^(1/2))^(2/3)*(9*c+(81*c^2+96)^(1/2))}

radnormal(eval(%,c=-3));

                               {t = 1}