minhthien2016

415 Reputation

6 Badges

8 years, 327 days

MaplePrimes Activity


These are questions asked by minhthien2016

I have this code. In the latex file, I get The vertical asymptote of the graph is $x = -{\dfrac{1}{4}}$. How can I get $x = -\dfrac{1}{4}$.

restart;
with(StringTools);
do_my_list := proc() 
    local toX, my_format; 
    toX := e -> latex(e, 'output' = 'string'); 
    my_format := proc(e)::string; 
        local s::string; 
        s := toX(e); 
        s := SubstituteAll(s, "*", " "); 
        s := StringTools:-SubstituteAll(s, "\\frac", "\\dfrac"); 
        s := StringTools:-SubstituteAll(s, "\\sqrt", "\\sqrt{\\,}"); 
        return s; 
    end proc; 
    return my_format; 
end proc;

L := [(x^2 + 3*x - 7)/(3*x - 2), (x^2 - 4*x + 1)/(4*x + 1)];
fmt := do_my_list();

RR := cat(
"\n\\documentclass[12pt,a4paper]{article}",
"\n\\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}",
"\n\\usepackage[utf8]{vietnam}",
"\n\\usepackage{amsmath}",
"\n\\usepackage{amsthm}",
"\n\\usepackage{enumitem}",
"\n\\theoremstyle{definition}",
"\n\\newtheorem{ex}{Example}",
"\n\\begin{document}\n\n"
);

for i to nops(L) do
    f := L[i];
    TV := solve(denom(f) = 0, x);
    q := simplify(quo(numer(f), denom(f), x));
    TX := q;
    f_ltx := fmt(f);
    TX_ltx := fmt(TX);
    TV_ltx := fmt(TV);
    RR := cat(
        RR,
        sprintf("\\begin{ex} Let be given a function $\\displaystyle y = %s$. We have:\n", f_ltx),
        "\\begin{enumerate}[label=\\arabic*)]\n",
        sprintf("\\item The vertical asymptote of the graph is $x = %s$.\n", TV_ltx),
        sprintf("\\item The oblique (or slant) asymptote of the graph is $y = %s$.\n", TX_ltx),
        "\\end{enumerate}\n\\end{ex}\n\n"
    );
end do;

RR := cat(RR, "\\end{document}");

fout := fopen("baitap_tiemcan.tex", WRITE);
fprintf(fout, "%s", RR);
fclose(fout);
print("Đã tạo file: baitap_tiemcan.tex");
 

I am using S := sort([sqrt(x2), sqrt(y2), sqrt(z2)]);

restart;
n := 0:
L := []:

for a from 3 to 100 do
    for b from 3 to a do
        c2 := a^2 - a*b + b^2;
        c := isqrt(c2);
        if c^2 = c2 then
            if c < a + b and a < b + c and b < c + a then
                if igcd(a, b, c) = 1 then
                    x2 := (-a^2 + b^2 + c^2)/2;
                    y2 := (a^2 - b^2 + c^2)/2;
                    z2 := (a^2 + b^2 - c^2)/2;
                    if 0 < x2 and 0 < y2 and 0 < z2 then
                        S := sort([sqrt(x2), sqrt(y2), sqrt(z2)]);
                        x := S[1]; 
                        y := S[2]; 
                        z := S[3];
                        n := n + 1;
                        L := [op(L), [x, y, z, sqrt(x^2 + y^2), sqrt(y^2 + z^2), sqrt(x^2 + z^2)]];
                    end if;
                end if;
            end if;
        end if;
    end do;
end do;

n;
L;
 

But I get the result. How can I get the correct result of sort? 

I see this question
https://mathematica.stackexchange.com/questions/309952/how-to-choose-6-numbers-from-the-following-set-so-that-they-represent-the-length
and tried

primes := [seq(ithprime(i), i = 1 .. 20)];
with(combinat);
all_combinations := choose(primes, 6);

I can not make next part.

For a right triangle with two legs of the right triangle a and b, draw three circles with radius r and one ellipse as shown in the diagram (the major axis of the ellipse is parallel to the hypotenuse of the right triangle). Find a relationship between a, b, and r

How can I make some triangles in a bigger triangle knowing its perimeters like this picture?

1 2 3 4 5 6 7 Last Page 2 of 19