acer

32303 Reputation

29 Badges

19 years, 308 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

First, and most importantly, notice that,
   0 < x and x <> 2
evaluates to just,
   0 < x
since <> and = evaluate as if under evalb, with active and.

In this case you are running into the effect of,

evalb( x <> 2 );
             true

So 0 < x and x <> 2 becomes 0 < x and true, which becomes just 0<x . Not what you intended!

This subtlety has caught out many Maple users; you're in good company.

Instead, you can use an inert form such as (captitalized) And .

restart;


Note that the following produces just x>0
So don't pass that to solve !

0 < x and x <> 2

0 < x

d2 := solve(And(0 < x, x <> 2), x);

RealRange(Open(2), infinity), RealRange(Open(0), Open(2))

lprint(d2);

RealRange(Open(2),infinity), RealRange(Open(0),Open(2))

map[2](`::`,x,Or(d2));

Or(x::(RealRange(Open(2), infinity)), x::(RealRange(Open(0), Open(2))))

convert(%, relation);

Or(And(2 < x, x <= infinity), And(0 < x, x < 2))

map[2](`in`,x,Or(d2));

Or(`in`(x, RealRange(Open(2), infinity)), `in`(x, RealRange(Open(0), Open(2))))

convert(%, relation);

Or(And(2 < x, x <= infinity), And(0 < x, x < 2))


Download solve_ineq_1.mw

Now, we've obtained more consistent results. And if you're wondering why the slightly different forms of input produce the different forms of output, well, it's because it's more useful to have the choice. (It's been noted previously, and reported, that documentation of all the input/ouput forms from solve are under-documented.)

I am guessing that you'd like all the real roots to be stored, in the case that there are multiple real roots for a given set of parameter values. If not you can pass the option maxsols=1 to fsolve.

restart;


Here I'll just use the expression-form calling sequence of fsolve,
where the first argument is an expression and the second is of
the form x=range.

Reg_IV := proc(beta, n)
  local alpha, b, c, d, k, `&alpha;L`,
        `&alpha;R`, delta, eqn, x;
  `&alpha;L` := 3+beta-6*beta^(1/2);
  `&alpha;R` := 1-beta; delta := (`&alpha;R`-`&alpha;L`)/n;
  print(`&beta; = `, evalf(beta, 5), `n = `, evalf(n, 5));
  print(`&alpha;L = `, evalf(`&alpha;L`, 5),
        `&alpha;R = `, evalf(`&alpha;R`, 5),
        `&delta; = `, evalf(delta, 5));
  print(``);
  for k from 0 to n+1 do
    alpha := `&alpha;L`+k*delta;
    b := -5+alpha-3*beta;
    c := 8-4*alpha-6*beta+2*beta^2-2*alpha*beta;
    d := -(4*beta+4)*(1-alpha-beta);
    eqn := x^3+b*x^2+c*x+d;
    x[k] := [fsolve(eqn, x=0 .. 2)];
    print(evalf(x[k], 5));
  end do;
  print(``);
  print(evalf(x, 5));
end proc:

Reg_IV(0.2, 4);

`&beta; = `, .2, `n = `, 4.

`&alpha;L = `, .51672, `&alpha;R = `, .8, `&delta; = `, 0.70820e-1

``

[]

[]

[.23706, .71971]

[.10761, .79636]

[0., .85081]

[.89400]

``

x


You could use the operator-form calling sequence of fsolve, but
notice that by default that would only return a single root. You could pass
fsolve the maxsols=3 option, but that's still less efficient that using the
expression-form calling sequence above, which returns all real roots
of the polynomial by default.

Reg_IV := proc(beta, n)
  local alpha, b, c, d, k, `&alpha;L`,
        `&alpha;R`, delta, eqn, x;
  `&alpha;L` := 3+beta-6*beta^(1/2);
  `&alpha;R` := 1-beta; delta := (`&alpha;R`-`&alpha;L`)/n;
  print(`&beta; = `, evalf(beta, 5), `n = `, evalf(n, 5));
  print(`&alpha;L = `, evalf(`&alpha;L`, 5),
        `&alpha;R = `, evalf(`&alpha;R`, 5),
        `&delta; = `, evalf(delta, 5));
  print(``);
  for k from 0 to n+1 do
    alpha := `&alpha;L`+k*delta;
    b := -5+alpha-3*beta;
    c := 8-4*alpha-6*beta+2*beta^2-2*alpha*beta;
    d := -(4*beta+4)*(1-alpha-beta);
    eqn := unapply(x^3+b*x^2+c*x+d, x);
    x[k] := [fsolve(eqn, 0 .. 2, maxsols=3)];
    if hastype(x[k],specfunc(fsolve)) then
      x[k] := [];
    end if;
    print(evalf(x[k], 5));
  end do;
  print(``);
  print(evalf(x, 5));
end proc:

Reg_IV(0.2, 4);

`&beta; = `, .2, `n = `, 4.

`&alpha;L = `, .51672, `&alpha;R = `, .8, `&delta; = `, 0.70820e-1

``

[]

[]

[.23706, .71971]

[.10761, .79636]

[.85081]

[.89400]

``

x

Download fsolve_oper_expr_ex.mw

ps. Some people prefer the alternate name MakeFunction instead of unapply. That's moot if you want all the roots, since using expression-form for fsolve is more efficient in that case.

pps. I put the roots in a list, since in the case of multiple roots I expect you'll find it slightly more straightforward to deal with a stored list rather than deal with stored expression sequences.

I hope you realize that numerically integrating the numerically computed derivative is (numerically) generally a bad idea.

Also, I suppose that you realize such numeric computation is not all necessary here, and that (as you say) you are trying to establish something about the three numeric solvers in play here.

But you have been unclear as to why you think that this methodology shows something significant and what precisely that might be. (Also, why differentiate numerically at all?) There are so many controls in play here (eg. the working precision in each of the three numeric solvers in play, tolerances, etc.) that you blanket/vague goal lacks focus and thus meaning. This is the kind of thing where it's more sensible to start with the numeric requirements, explicitly. Then see if you can attain them. Otherwise (IMO) you risk flailing more with the functionality choices and missing something key.

With all of the 1) numeric pde solver, 2) numeric differentiation outside that pde solver (ugh), and 3) numeric integration then any numeric difficulties are going to be a causality muddle. How would you ever decide which might be some weak link? (especially considering that not all the parts are necessary...)

It's not clear to me what you mean by, "...the global form of the conservation law over time".

Is this the kind of numeric integration you were trying to get at? (I'm not suggesting that this is the plot you're after. I include it merely to go with that integration result at the particular t=0 point.)

restart;

pde := diff(v(x, t), t, t) = diff(v(x, t), x, x):

f := xi -> exp(-xi^2):

a := -10: b := 10: dx := 1/50: t_final := 10:

pds := pdsolve(pde, {v(a, t) = 0, v(b, t) = 0, v(x, 0) = f(x + 5),
                     D[2](v)(x, 0) = -eval(diff(f(x), x), x = x + 5)},
               numeric, range = a .. b, time = t, spacestep = dx):

sol_proc := rhs(pds:-value(output = listprocedure)[3]):

sol := (x, t) -> piecewise(a < x and x < b, sol_proc(x, t), 0):

plot(D[2](sol)(x,0), x=a..b, size=[500,200]);

evalf(Int(D[2](sol)(x,0), x=a..b, digits=10, epsilon=1e-5, method=_d01ajc));

-0.5778633229e-10

Download pde_num_hmm.mw

ps. Here's another syntax for the integration and plot above. You original syntax was not ok, using an fdiff call like an expression alongside the (operator style) a..b for the range of integration.

evalf(Int(x->fdiff(sol_proc(x, t), [t = 0]),
          a .. b, digits=10, epsilon=1e-5, method=_Dexp));
plot(x->fdiff(sol_proc(x, t), [t = 0]), a .. b, size=[500,200]);

Are you perhaps looking for something like the following:

[seq(RootOf(det_num, Omega, index = i), i = 1 .. 3)];
plot(%, omega__v = 0 .. 2, size = [400, 400]);

I'm not 100% sure how your code is supposed to work.

On my machine the following takes about 14sec, compared to the original taking about 24sec.

Formula_II_acK.mw

(It's not easy to work with this code when it's "behind" a Button. But I've put my edits back there because that's how you gave it to us.)

A significant portion of the outstanding time is now taken by the coeftayl calls.

I hazard a guess that some of the following might be possible:
a) Form parts or a variant of `Eq` just once, and then instantiate more quickly when the input Components's values change.
b) Figure out a way to have the coeftayl results be done symbolically, so as to instantiate a template rather than do its heavy lifting for each set of Component values.

I expect that there are further improvements possible. Alas I'm out of time for this, sorry.

I noticed that if I changed parameter N from 0.5 to 1/2 then the solve step seemed to slow down. Hopefully that is all "above board" and not any hint that your current results are actually slightly suspect.

Here I use the formula as in your picture, with the x- and y-components switched. And so a similar plot can attain.

plots:-display(
  plots:-spacecurve([t*cos(t),t*sin(t),2*sqrt(2)/3*t^(3/2)],t=0..Pi,
                    thickness=4,color=black),
  axes=normal,view=[-3..3,-2..4,-2..8], scaling=constrained,
  orientation=[50,70,0]);

You also mentioned 2D plotting, but that could mean several different things and you haven't explained what you are after. Perhaps a projection of that spacecurve, onto the x-y or some other plane?

G := x^5 - 5*x^4 - 35*x^3:

C := mul(x-(a+i*d),i=0..4):

S := solve({seq(coeff(C,x,i)=coeff(G,x,i),i=3..4)});

{a = -5, d = 3}, {a = 7, d = -3}

R := seq(eval(a+i*d,S[1]),i=0..4);

-5, -2, 1, 4, 7

P := expand(eval(C,S[1]));

x^5-5*x^4-35*x^3+125*x^2+194*x-280

Download poly_puzz.mw

The roots are R, and the polynomial is P.

@C_R Notice that your code does not assign the expression to a name, and merely reuse it at the different values of Digits.

Rather, your code explicitly re-forms the expression at the different values of Digits.

The 1e-11 invocation forms the very same float expression at both Digits settings. But the 0.1*10^11 forms different float expressions at those two different values of Digits.

The differing coefficients makes the expressions being passed be to is be different (ie. different address, etc).

That makes the remember table get used for one flavor (where the expression passed is identical) but not the other (where the expression passed is different).

Digits := 10;

10

addressof(0.1*10^11);
dismantle(1e-11);

36893628647194360668


FLOAT(3): .1e-10
   INTPOS(2): 1
   INTNEG(2): -11
 

addressof(0.1*10^11);
dismantle(0.1*10^11);

36893628647194360668


FLOAT(3): .1000000000e11
   INTPOS(2): 1000000000
   INTPOS(2): 1
 

Digits:=30;

30

addressof(1e-11);
dismantle(1e-11);

36893628647194746428


FLOAT(3): .1e-10
   INTPOS(2): 1
   INTNEG(2): -11
 

addressof(0.1*10^11);
dismantle(0.1*10^11);

36893628647194377852


FLOAT(3): 10000000000.0
   INTPOS(2): 100000000000
   INTNEG(2): -1
 

Download flt_ex.mw

On the other hand, if you formed the two expressions just once, up front, then the remembered can interfere (here, consistently).

eval_of_range_in_ln_ac2.mw

So, the cause is that (only) one of those constructions produce identical results at differing Digits.

Your attachment had an invalid Equation blob of XML, just after the "Kronecker Delta" text.

Removing that I get the following, which opens ok in Maple 2022.2.

Lecture_2_notes_ac.mw

ps. Maple 2024 seems to have much less of this kind of problem (and might even be able to itself recover your attachment acceptably...). If your school offers it then I suggest you upgrade.

ps. The Mapleprimes posting editor's toolbar has a green up-arrow that allows on to upload and attach worksheet documents to posts. In future you could use that instead of a 3rd-party download site.

Your code snippet shows the name shift being used both as an optional parameter of F as well as for an equation in each of the lists passed for the Q, vec, and point parameter of F. It seems that you want to be able to pass those independently, when calling F.

You might also want one of those to override the other, ie. either the instances inside the lists, or the separate parameter. I've made a guess as to which that might be, since you haven't really explained your goal. (You should easily be able to switch which might be an override, or instead utilize them wholly separately, and/or assign the values to three different locals, etc.)

Using variants on the code below you should be able to access the shift equations (and their rhs values) specified by each of your Q, vec, or point lists. Accessing each of those simply involves using the eval command.

Eg., inside F, you can do any of,
   eval(':-shift',Q)
   eval(':-shift',vec)
   eval(':-shift',point)

One of your queries here is about how to access the rhs of shift=something when that appears in a list. That was also in a Reply of another recent Question of yours on this site. And I used the same approach above as previously recommended -- 2-argument eval -- the only difference is that now you have different local/param vs global references of the name hanging about.

(Again, you didn't state whether you wanted the separate shift optional parameter of F be subordinate, or an override, or unrelated to those three. I've made a guess, and demonstrated a way in which they could inter-relate. Remove that aspect, if not desired.)

restart;
F := proc(point::list:=[':-symbolsize'=12,':-symbol'=':-solidcircle',
                        ':-colour'=':-blue',':-shift'=0.4],
          shift::float:=0.7)
  local lshift;
  if eval(':-shift',point)::float then
    lshift := eval(':-shift',point);
  else
    lshift := shift;
  end if;
  lshift;
end proc:

 

F();

.4

F([symbolsize=12,symbol=solidcircle,colour=blue]);

.7

F([symbolsize=12,symbol=solidcircle,colour=blue,':-shift'=foo]);

.7

F([symbolsize=12,symbol=solidcircle,colour=blue,':-shift'=':-shift']);

.7

F([symbolsize=12,symbol=solidcircle,colour=blue,':-shift'=0.3]);

.3


Download param_pr_2.mw

I think that you could make it more clear and explicit what behavior you want an expect here. Showing a representative variety of function calls and corresponding expected results (even if the proc code is not given) is a basic thing. You should be explicit about the functionality you want.

ps. I suggest that you run maplemint on your procedures. I expect that you might find that it reports quite a few cases where global names are being used without protection against having prior values. (Eg. Try to run your example with :-shift assigned a float value at the top-level, and see what breaks, etc, etc.) I've tried to make the above "mint-clean".

pps. I understand that your actual procedures might be too long to include here. But you really ought to at least try to write a shorter proc and example that is self-contained and illustrates your query and runs stand-alone. In this case it wouldn't take long.

You wrote that you wanted to solve the pde numerically, so I'll address that methodology.

In that case you could try setting up that BC with a call to a black-box procedure, by which I mean a procedure that returns the numeric integration result when passed a numeric input, but for which a symbolic function call returns unevaluated.

This technique can also be used for some other flavors of example; ie. the black-box procedure doesn't necessarily involve an integral.

restart;

pde := diff(v(x, t), t) = diff(v(x, t), x, x);

diff(v(x, t), t) = diff(diff(v(x, t), x), x)

f := x -> exp(-x^2);

proc (x) options operator, arrow; exp(-x^2) end proc

a := -1.68858; b := 1.68858; delx := 1e-2;

-1.68858

1.68858

0.1e-1

K := proc(x) #option trace;
 local res, s;
 if not x::numeric then return 'procname'(args); end if;
 res := evalf[15](1 - Int(f(f(s)), s = 0 .. x, method=_d01ajc, digits=15, epsilon=1e-10));
 evalf[10](res);
end proc:

K(x); # unevaluated. like a black box.

K(x)

plot(K(x), x=-2..2);

sol := pdsolve(pde, {v(a, t) = 0, v(b, t) = 0,
                     v(x, 0) = K(x)},
               numeric, range = a .. b, time = t, spacestep = delx):

F[1] := sol:-value(t=1,output=listprocedure):

plot(eval(v(x,t),F[1]), a..b);

sol:-plot3d(t=0..5,x=a..b,axes=boxed);

sol:-animate(t=1,frames=100);

 

 

Download pds_bb.mw

That region can be shaded using the plots:-shadebetween command. (There are several other ways, using say plots:-inequal or plots:-implicitplot)

Just for fun, I played with some other options for the overall look&feel. Adust to taste.

shb.mw

See here the response about disabling scrollable rtables.

Disabling that GUI preference seems to have fixed a similar instance of the problem.

Is this the kind of effect that you're after?

(There might be a terser way; I just edited what you had before...)

restart;

F := proc(ee, LL)
  local Hx,Hy;
  Hx := nprintf(`#mfenced(mrow(%a,mo("&InvisibleTimes;"),mi("x")));`,
                Typesetting:-Typeset(Typesetting:-EV(LL[1])));
  Hy := nprintf(`#mfenced(mrow(%a,mo("&InvisibleTimes;"),mi("y")));`,
                Typesetting:-Typeset(Typesetting:-EV(LL[2])));
 Typesetting:-mrow(InertForm:-Typeset(InertForm:-Display(eval(eval(InertForm:-MakeInert(factor(ee)), [`%*` = `*`]) = InertForm:-MakeInert(sort(algsubs(b*y = Hy, algsubs(a*x = Hx, ee)), order = plex(Hx,Hy))), `=`~([a, b], LL)), inert = false)), Typesetting:-mo("="), InertForm:-Typeset(eval(ee, `=`~([a, b], LL)))); end proc:

p := a^3*x^3 + 3*a^2*b*x^2*y + 3*a*b^2*x*y^2 + b^3*y^3;

a^3*x^3+3*a^2*b*x^2*y+3*a*b^2*x*y^2+b^3*y^3

L := [[2, 3], [1, 2], [1/3, -sqrt(2)]];

[[2, 3], [1, 2], [1/3, -2^(1/2)]]

ans := F~(p, L);

[Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y"))), Typesetting:-_Hold([`%+`(2*x, 3*y)])))), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`%+`(2*x, 3*y), 3)])), Typesetting:-mo("&equals;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 3)])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&sdot;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("2"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 2)])), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-_Hold([`%*`(3, `%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`)])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic"), Typesetting:-mo("&sdot;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("2"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 2)]))), Typesetting:-_Hold([`%*`(3, `#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 2))])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 3)]))), Typesetting:-_Hold([`%+`(`%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting:-mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 3))]))), Typesetting:-mo("="), Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mn("8"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mn("3"))), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("36"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("54"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("2"))), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("27"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("3"))))), Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mi("x"), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y"))), Typesetting:-_Hold([`%+`(x, 2*y)])))), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`%+`(x, 2*y), 3)])), Typesetting:-mo("&equals;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("1"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 3)])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&sdot;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("1"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("2"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 2)])), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-_Hold([`%*`(3, `%^`(`#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`)])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("1"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic"), Typesetting:-mo("&sdot;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("2"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 2)]))), Typesetting:-_Hold([`%*`(3, `#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 2))])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 3)]))), Typesetting:-_Hold([`%+`(`%^`(`#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting:-mn("1"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting:-mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 3))]))), Typesetting:-mo("="), Typesetting:-mrow(Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mn("3")), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("6"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("12"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("2"))), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("8"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("3"))))), Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mi("x"), Typesetting:-mn("3")), Typesetting:-mo("&minus;"), Typesetting:-mrow(Typesetting:-msqrt(Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y"))), Typesetting:-_Hold([`%+`((1/3)*x, -2^(1/2)*y)])))), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`%+`((1/3)*x, -2^(1/2)*y), 3)])), Typesetting:-mo("&equals;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mn("3")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 3)])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&sdot;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mn("3")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("2"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 2)])), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-msqrt(Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-_Hold([`%*`(3, `%^`(`#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`)])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&sdot;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mn("1"), Typesetting:-mn("3")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")), Typesetting:-msemantics = "atomic"), Typesetting:-mo("&sdot;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-msqrt(Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("2"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 2)]))), Typesetting:-_Hold([`%*`(3, `#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 2))])), Typesetting:-mo("&plus;"), Typesetting:-mcomplete(Typesetting:-msup(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-msqrt(Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-msemantics = "atomic")), Typesetting:-mn("3"), Typesetting:-msemantics = "^"), Typesetting:-_Hold([`%^`(`#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 3)]))), Typesetting:-_Hold([`%+`(`%^`(`#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mn("3")),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting:-mrow(Typesetting:-mo("&uminus0;"),Typesetting:-msqrt(Typesetting:-mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 3))]))), Typesetting:-mo("="), Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mn("3")), Typesetting:-mn("27")), Typesetting:-mo("&minus;"), Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-msqrt(Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("x"), Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("y")), Typesetting:-mn("3")), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("2"))), Typesetting:-mo("&minus;"), Typesetting:-mrow(Typesetting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msqrt(Typesetting:-mn("2")), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("3")))))]

print~(ans):

`%^`(`%+`(2*x, 3*y), 3) = `%+`(`%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting`:-`mn("3"),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting`:-`mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting`:-`mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 3)) and `%+`(`%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting`:-`mn("3"),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting`:-`mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting`:-`mn("3"),mo("&InvisibleTimes;"),mi("y")));`, 3)) = 8*x^3+36*x^2*y+54*x*y^2+27*y^3

`%^`(`%+`(x, 2*y), 3) = `%+`(`%^`(`#mfenced(mrow(Typesetting`:-`mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting`:-`mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting`:-`mn("1"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 3)) and `%+`(`%^`(`#mfenced(mrow(Typesetting`:-`mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting`:-`mn("1"),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting`:-`mn("1"),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting`:-`mn("2"),mo("&InvisibleTimes;"),mi("y")));`, 3)) = x^3+6*x^2*y+12*x*y^2+8*y^3

`%^`(`%+`((1/3)*x, -sqrt(2)*y), 3) = `%+`(`%^`(`#mfenced(mrow(Typesetting`:-`mfrac(Typesetting`:-`mn("1"),Typesetting`:-`mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting`:-`mfrac(Typesetting`:-`mn("1"),Typesetting`:-`mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting`:-`mrow(Typesetting`:-`mo("&uminus0;"),Typesetting`:-`msqrt(Typesetting`:-`mn("2"))),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting`:-`mfrac(Typesetting`:-`mn("1"),Typesetting`:-`mn("3")),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting`:-`mrow(Typesetting`:-`mo("&uminus0;"),Typesetting`:-`msqrt(Typesetting`:-`mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting`:-`mrow(Typesetting`:-`mo("&uminus0;"),Typesetting`:-`msqrt(Typesetting`:-`mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 3)) and `%+`(`%^`(`#mfenced(mrow(Typesetting`:-`mfrac(Typesetting`:-`mn("1"),Typesetting`:-`mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 3), `%*`(3, `%^`(`#mfenced(mrow(Typesetting`:-`mfrac(Typesetting`:-`mn("1"),Typesetting`:-`mn("3")),mo("&InvisibleTimes;"),mi("x")));`, 2), `#mfenced(mrow(Typesetting`:-`mrow(Typesetting`:-`mo("&uminus0;"),Typesetting`:-`msqrt(Typesetting`:-`mn("2"))),mo("&InvisibleTimes;"),mi("y")));`), `%*`(3, `#mfenced(mrow(Typesetting`:-`mfrac(Typesetting`:-`mn("1"),Typesetting`:-`mn("3")),mo("&InvisibleTimes;"),mi("x")));`, `%^`(`#mfenced(mrow(Typesetting`:-`mrow(Typesetting`:-`mo("&uminus0;"),Typesetting`:-`msqrt(Typesetting`:-`mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 2)), `%^`(`#mfenced(mrow(Typesetting`:-`mrow(Typesetting`:-`mo("&uminus0;"),Typesetting`:-`msqrt(Typesetting`:-`mn("2"))),mo("&InvisibleTimes;"),mi("y")));`, 3)) = (1/27)*x^3-(1/3)*sqrt(2)*x^2*y+2*x*y^2-2*sqrt(2)*y^3; "_noterminate"


Download minhthien_ts.mw

I have used Maple 2024.1 below.

You can use fprintf instead of printf, if you want to write to a file.

(please check for typos.)

restart:

F := proc(ee,LL)
  uses InertForm, Typesetting;
  mrow(Typeset(Display(eval(eval(MakeInert(factor(ee)),[`%*`=`*`])
                                 =MakeInert(subs(b=MakeInert(b*y)/y,
                        a=MakeInert(a*x)/x,p)),[a,b]=~LL),
                       inert=false)),
       mo("&equals;"),Typeset(eval(ee,[a,b]=~LL)))
end proc:
p := (a*x)^2 - 2*a*x*b*y + (b*y)^2:
L := [[sqrt(2),3],[2,5],[3,12],[1/3,5/7]]:
ans := F~(p, L):

 

print~(ans):

`%^`(`%+`(sqrt(2)*x, -3*y), 2) = `%+`(`%^`(`%*`(sqrt(2), x), 2), `%*`(-2, `%*`(sqrt(2), x), `%*`(3, y)), `%^`(`%*`(3, y), 2)) and `%+`(`%^`(`%*`(sqrt(2), x), 2), `%*`(-2, `%*`(sqrt(2), x), `%*`(3, y)), `%^`(`%*`(3, y), 2)) = 2*x^2-6*sqrt(2)*x*y+9*y^2

`%^`(`%+`(2*x, -5*y), 2) = `%+`(`%^`(`%*`(2, x), 2), `%*`(-2, `%*`(2, x), `%*`(5, y)), `%^`(`%*`(5, y), 2)) and `%+`(`%^`(`%*`(2, x), 2), `%*`(-2, `%*`(2, x), `%*`(5, y)), `%^`(`%*`(5, y), 2)) = 4*x^2-20*x*y+25*y^2

`%^`(`%+`(3*x, -12*y), 2) = `%+`(`%^`(`%*`(3, x), 2), `%*`(-2, `%*`(3, x), `%*`(12, y)), `%^`(`%*`(12, y), 2)) and `%+`(`%^`(`%*`(3, x), 2), `%*`(-2, `%*`(3, x), `%*`(12, y)), `%^`(`%*`(12, y), 2)) = 9*x^2-72*x*y+144*y^2

`%^`(`%+`((1/3)*x, -(5/7)*y), 2) = `%+`(`%^`(`%*`(1/3, x), 2), `%*`(-2, `%*`(1/3, x), `%*`(5/7, y)), `%^`(`%*`(5/7, y), 2)) and `%+`(`%^`(`%*`(1/3, x), 2), `%*`(-2, `%*`(1/3, x), `%*`(5/7, y)), `%^`(`%*`(5/7, y), 2)) = (1/9)*x^2-(10/21)*x*y+(25/49)*y^2

RR := cat(
"\n\\documentclass[12pt,a4paper]{article}
\\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\\usepackage{amsmath}
\\usepackage{amsthm}
\\usepackage{enumitem}
\\theoremstyle{definition}
\\newtheorem{ex}{Exercise}
\\begin{document}\n\n",
seq(sprintf("\\begin{ex}\n\\[ %s \\]\n\\end{ex}\n",
            latex(ee, output=string)),ee=ans),
"\n\\end{document}"):

 

printf(RR);


\documentclass[12pt,a4paper]{article}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumitem}
\theoremstyle{definition}
\newtheorem{ex}{Exercise}
\begin{document}

\begin{ex}
\[ \left(\sqrt{2}\, x -3 y \right)^{2}=\left(\sqrt{2}\cdot x \right)^{2}-2\cdot \left(\sqrt{2}\cdot x \right)\cdot \left(3\cdot y \right)+\left(3\cdot y \right)^{2}=2 x^{2}-6 \sqrt{2}\, x y +9 y^{2} \]
\end{ex}
\begin{ex}
\[ \left(2 x -5 y \right)^{2}=\left(2\cdot x \right)^{2}-2\cdot \left(2\cdot x \right)\cdot \left(5\cdot y \right)+\left(5\cdot y \right)^{2}=4 x^{2}-20 x y +25 y^{2} \]
\end{ex}
\begin{ex}
\[ \left(3 x -12 y \right)^{2}=\left(3\cdot x \right)^{2}-2\cdot \left(3\cdot x \right)\cdot \left(12\cdot y \right)+\left(12\cdot y \right)^{2}=9 x^{2}-72 x y +144 y^{2} \]
\end{ex}
\begin{ex}
\[ \left(\frac{x}{3}-\frac{5 y}{7}\right)^{2}=\left(\frac{1}{3}\cdot x \right)^{2}-2\cdot \left(\frac{1}{3}\cdot x \right)\cdot \left(\frac{5}{7}\cdot y \right)+\left(\frac{5}{7}\cdot y \right)^{2}=\frac{1}{9} x^{2}-\frac{10}{21} x y +\frac{25}{49} y^{2} \]
\end{ex}

\end{document}

 

 

Download minhthien_latex.mw

First 15 16 17 18 19 20 21 Last Page 17 of 336