1 | test_expand = ->
|
2 | run_test [
|
3 |
|
4 |
|
5 |
|
6 | "expand(1/(x+1)/(x+2))",
|
7 | "1/(x+1)-1/(x+2)",
|
8 |
|
9 | "expand((2x^3-x+2)/(x^2-2x+1))",
|
10 | "4+2*x+5/(x-1)+3/(x^2-2*x+1)",
|
11 |
|
12 | "expand(1/x^2/(x-1))",
|
13 | "-1/(x^2)-1/x+1/(x-1)",
|
14 |
|
15 | "p=5s+2",
|
16 | "",
|
17 |
|
18 | "q=(s+1)*(s+2)^2",
|
19 | "",
|
20 |
|
21 | "expand(p/q)",
|
22 | "-3/(s+1)+3/(s+2)+8/(s^2+4*s+4)",
|
23 |
|
24 |
|
25 |
|
26 | "q=(x-1)*(x-2)^3",
|
27 | "",
|
28 |
|
29 | "expand(1/q)",
|
30 | "1/(x^3-6*x^2+12*x-8)+1/(x-2)-1/(x-1)-1/(x^2-4*x+4)",
|
31 |
|
32 |
|
33 |
|
34 | "expand(1/(x+1/2)/(x+1/3))",
|
35 | "-12/(2*x+1)+18/(3*x+1)",
|
36 |
|
37 |
|
38 |
|
39 | "f=1/(x+1)/(x+2)",
|
40 | "",
|
41 |
|
42 | "g=1/(x+1)-1/(x+2)",
|
43 | "",
|
44 |
|
45 | "expand([[f,f],[f,f]])-[[g,g],[g,g]]",
|
46 | "[[0,0],[0,0]]",
|
47 |
|
48 |
|
49 |
|
50 | "expand(1/(1+1/x))",
|
51 | "1-1/(x+1)",
|
52 |
|
53 |
|
54 |
|
55 | "expand(1/x/(x+1))",
|
56 | "1/x-1/(x+1)",
|
57 |
|
58 | "expand(1/x^2/(x+1))",
|
59 |
|
60 | "1/x^2-1/x+1/(x+1)",
|
61 |
|
62 |
|
63 |
|
64 | "expand(1/x)",
|
65 | "1/x",
|
66 |
|
67 | "expand(1/x^2)",
|
68 |
|
69 | "1/x^2",
|
70 |
|
71 | "expand(1/(x^2-4x+4))",
|
72 | "1/(x^2-4*x+4)",
|
73 |
|
74 |
|
75 |
|
76 | "expand(sin(x))",
|
77 | "sin(x)",
|
78 |
|
79 | "expand(x)",
|
80 | "x",
|
81 |
|
82 | "expand(1/sin(x))",
|
83 |
|
84 | "1/(sin(x))",
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | "expand(expand((sin(x)+1)^2))",
|
90 | "1+sin(x)^2+2*sin(x)",
|
91 |
|
92 | ]
|