@@ -665,7 +665,8 @@ public void testSystem038() {
665
665
666
666
check ("D(Cosh(x),x)" , "Sinh(x)" ); // issue#39
667
667
check ("D(x^4, x)" , "4*x^3" );
668
- check ("D((-x+2)/(2*x-6), x)" , "(-2*(2-x))/(6-2*x)^2+1/(6-2*x)" );
668
+ check ("D((-x+2)/(2*x-6), x)" , //
669
+ "(-2*(2-x))/(6-2*x)^2-1/(-6+2*x)" );
669
670
check ("D((2*x-6)^(-1), x)" , "-2/(6-2*x)^2" );
670
671
671
672
// (-x+2)*(2*x-6)^(-2)*2
@@ -680,15 +681,15 @@ public void testSystem038() {
680
681
check ("Trace(D(Sin(x),x))" , "{{{D(x,x),1},1*Cos(x),Cos(x)},Cos(x)}" );
681
682
check ("D(Sin(x)^Cos(x),x)" , "(Cos(x)*Cot(x)-Log(Sin(x))*Sin(x))*Sin(x)^Cos(x)" );
682
683
check ("Trace(D(Sin(x)^Cos(x),x))" ,
683
- "{{{IntegerQ(#1)&<0&[Cos(x)],IntegerQ(Cos(x))&&Cos(x)<0,{IntegerQ(Cos(x)),False},False}},Sin(x)^Cos(x)*(D(Cos(x),x)*Log(Sin(x))+(Cos(x)*D(Sin(x),x))/Sin(x)),{{IntegerQ(#1)&<\n " +
684
- "0&[Cos(x)],IntegerQ(Cos(x))&&Cos(x)<0,{IntegerQ(Cos(x)),False},False}},{{{{{D(x,x),\n " +
685
- "1},(-1)*1*Sin(x),-Sin(x)},-Sin(x)},Log(Sin(x))*-Sin(x),-Log(Sin(x))*Sin(x)},{{{{D(x,x),\n " +
686
- "1},1*Cos(x),Cos(x)},Cos(x)},{{IntegerQ(#1)&<0&[-1],IntegerQ(-1)&&-1<0,{IntegerQ(\n " +
687
- "-1),True},{-1<0,True},True},{{(-1)*(-1),1},Csc(x)^1,{IntegerQ(#1)&<0&[1],IntegerQ(\n " +
688
- "1)&&1<0,{IntegerQ(1),True},{1<0,False},False},Csc(x)},Csc(x)},Cos(x)*Cos(x)*Csc(x),Cot(x)^\n " +
689
- "1*Cos(x),{{IntegerQ(#1)&<0&[1],IntegerQ(1)&&1<0,{IntegerQ(1),True},{1<0,False},False},Cot(x)},Cos(x)*Cot(x)},Cos(x)*Cot(x)-Log(Sin(x))*Sin(x)},(Cos(x)*Cot(x)-Log(Sin(x))*Sin(x))*Sin(x)^Cos(x),{{IntegerQ(#1)&<\n " +
690
- "0&[Cos(x)],IntegerQ(Cos(x))&&Cos(x)<0,{IntegerQ(Cos(x)),False},False}},{{-Cos(x)*Cot(x),-Cos(x)*Cot(x)},{--Log(Sin(x))*Sin(x),(\n " +
691
- "-1)*(-1)*Log(Sin(x))*Sin(x),Log(Sin(x))*Sin(x)},-Cos(x)*Cot(x)+Log(Sin(x))*Sin(x)}}" );
684
+ "{{{IntegerQ(#1)&<0&[Cos(x)],IntegerQ(Cos(x))&&Cos(x)<0,{IntegerQ(Cos(x)),False},False}},Sin(x)^Cos(x)*(D(Cos(x),x)*Log(Sin(x))+(Cos(x)*D(Sin(x),x))/Sin(x)),{{IntegerQ(#1)&<\n "
685
+ + "0&[Cos(x)],IntegerQ(Cos(x))&&Cos(x)<0,{IntegerQ(Cos(x)),False},False}},{{{{{D(x,x),\n "
686
+ + "1},(-1)*1*Sin(x),-Sin(x)},-Sin(x)},Log(Sin(x))*-Sin(x),-Log(Sin(x))*Sin(x)},{{{{D(x,x),\n "
687
+ + "1},1*Cos(x),Cos(x)},Cos(x)},{{IntegerQ(#1)&<0&[-1],IntegerQ(-1)&&-1<0,{IntegerQ(\n "
688
+ + "-1),True},{-1<0,True},True},{{(-1)*(-1),1},Csc(x)^1,{IntegerQ(#1)&<0&[1],IntegerQ(\n "
689
+ + "1)&&1<0,{IntegerQ(1),True},{1<0,False},False},Csc(x)},Csc(x)},Cos(x)*Cos(x)*Csc(x),Cot(x)^\n "
690
+ + "1*Cos(x),{{IntegerQ(#1)&<0&[1],IntegerQ(1)&&1<0,{IntegerQ(1),True},{1<0,False},False},Cot(x)},Cos(x)*Cot(x)},Cos(x)*Cot(x)-Log(Sin(x))*Sin(x)},(Cos(x)*Cot(x)-Log(Sin(x))*Sin(x))*Sin(x)^Cos(x),{{IntegerQ(#1)&<\n "
691
+ + "0&[Cos(x)],IntegerQ(Cos(x))&&Cos(x)<0,{IntegerQ(Cos(x)),False},False}},{{-Cos(x)*Cot(x),-Cos(x)*Cot(x)},{--Log(Sin(x))*Sin(x),(\n "
692
+ + "-1)*(-1)*Log(Sin(x))*Sin(x),Log(Sin(x))*Sin(x)},-Cos(x)*Cot(x)+Log(Sin(x))*Sin(x)}}" );
692
693
}
693
694
694
695
public void testSystem039 () {
@@ -964,9 +965,9 @@ public void testSystem080() {
964
965
965
966
public void testSystem081 () {
966
967
check ("Inverse(s*{{1,0,0},{0,1,0},{0,0,1}}-{{-1,1,1},{-4,-4,1},{1,1,1}})" ,
967
- "{{(5-3*s-s^2)/(10-s-4*s^2-s^3),s/(-10+s+4*s^2+s^3),(5+s)/(-10+s+4*s^2+s^3)},\n " +
968
- " {(5-4*s)/(-10+s+4*s^2+s^3),(2-s^2)/(10-s-4*s^2-s^3),(-3+s)/(-10+s+4*s^2+s^3)},\n " +
969
- " {-s/(10-s-4*s^2-s^3),(-2-s)/(10-s-4*s^2-s^3),(8+5*s+s^2)/(-10+s+4*s^2+s^3)}}" );
968
+ "{{(5-3*s-s^2)/(10-s-4*s^2-s^3),s/(-10+s+4*s^2+s^3),(5+s)/(-10+s+4*s^2+s^3)},\n "
969
+ + " {(5-4*s)/(-10+s+4*s^2+s^3),(2-s^2)/(10-s-4*s^2-s^3),(-3+s)/(-10+s+4*s^2+s^3)},\n "
970
+ + " {-s/(10-s-4*s^2-s^3),(-2-s)/(10-s-4*s^2-s^3),(8+5*s+s^2)/(-10+s+4*s^2+s^3)}}" );
970
971
check ("N(Inverse({{1,2.0},{3,4}}),50)" , "{{-2,1},\n " + " {1.5,-5e-1}}" );
971
972
972
973
check ("Inverse({{1,2},{3,4}})" , "{{-2,1},\n " + " {3/2,-1/2}}" );
@@ -1524,16 +1525,15 @@ public void testSystem171() {
1524
1525
public void testSystem171a () {
1525
1526
check ("Integrate(1/(x^5+x-7),x)" , //
1526
1527
"Integrate(1/(-7+x+x^5),x)" );
1527
-
1528
-
1528
+
1529
1529
check ("Rubi`PolyQ(x/(2*Sqrt(2)),x,1)" , //
1530
1530
"True" );
1531
1531
check ("Rubi`PolyQ((2+2*x)/(2*Sqrt(2)),x)" , //
1532
1532
"True" );
1533
- // check("Rubi`PolyQ(2+2 *x,x,1)", //
1534
- // "True");
1535
- // check("Rubi`PolyQ(-(ArcTan((1+x)/Sqrt(2))/(2 Sqrt(2))),x )", //
1536
- // "True");
1533
+ // check("Rubi`PolyQ(2+2 *x,x,1)", //
1534
+ // "True");
1535
+ // check("Rubi`PolyQ(-(ArcTan((1+x)/Sqrt(2))/(2 Sqrt(2))),x )", //
1536
+ // "True");
1537
1537
check ("Rubi`substaux(-ArcTan(x/(2*Sqrt(2)))/(2*Sqrt(2)),x,2+2*x,True)" , //
1538
1538
"-ArcTan((1+x)/Sqrt(2))/(2*Sqrt(2))" );
1539
1539
check ("Integrate((x^2+2*x+3)^(-1),x)" , //
@@ -1666,17 +1666,16 @@ public void testSystem171b() {
1666
1666
1667
1667
public void testSystem172 () {
1668
1668
1669
- check ("Cos((a-b)*x)/(2*(a-b))-Cos((a+b)*x)/(2*(a+b))" ,
1670
- "Cos((a-b)*x)/(2*(a-b))-Cos((a+b)*x)/(2*(a+b))" );
1669
+ check ("Cos((a-b)*x)/(2*(a-b))-Cos((a+b)*x)/(2*(a+b))" , "Cos((a-b)*x)/(2*(a-b))-Cos((a+b)*x)/(2*(a+b))" );
1671
1670
check ("Integrate(Cos(a*x)*Sin(b*x),x)" , //
1672
1671
"Cos((a-b)*x)/(2*(a-b))-Cos((a+b)*x)/(2*(a+b))" );
1673
1672
check ("Integrate(Cos(a*x)*Sin(b*x),x)" , //
1674
1673
"Cos((a-b)*x)/(2*(a-b))-Cos((a+b)*x)/(2*(a+b))" );
1675
-
1674
+
1676
1675
check ("Csc(b*x)^0" , "1" );
1677
1676
check ("Integrate(Cos(x*(a+b)),x)" , //
1678
1677
"Sin((a+b)*x)/(a+b)" );
1679
-
1678
+
1680
1679
check ("Integrate(Cos(a*x)*Sin(b*x)^2,x)" ,
1681
1680
"Sin(a*x)/(2*a)-Sin((a-2*b)*x)/(4*(a-2*b))-Sin((a+2*b)*x)/(4*(a+2*b))" );
1682
1681
check ("Integrate(Cos(a*x)^2*Sin(b*x),x)" ,
@@ -3182,7 +3181,7 @@ public void testSystem804() {
3182
3181
check ("Integrate(1/(x^3 + 1), x)" , //
3183
3182
"Log(1+x)/3-Log(1-x+x^2)/6" );
3184
3183
check ("D(1/3*(-3*ArcTan((2*x+1)*3^(-1/2))*3^(-1/2)-1/2*Log(x^2-x+1))+1/3*Log(x+1), x)" , //
3185
- "1/(3*(1+x))+1/3*(-(-1+2*x)/(2*(1-x+x^2))+ 2/(-1- (1+2*x)^2/3))" );
3184
+ "1/(3*(1+x))+1/3*(-(-1+2*x)/(2*(1-x+x^2))- 2/(1+ (1+2*x)^2/3))" );
3186
3185
check ("Simplify(D(Integrate(1/(x^3 + 1), x), x))" , //
3187
3186
"(1-x)/(2*(1+x^3))" );
3188
3187
// check("Apart((1+(1/x))/(1+(2/x)))","");
@@ -3329,14 +3328,15 @@ public void testSystem994() {
3329
3328
}
3330
3329
3331
3330
public void testSystem995 () {
3332
- check ("Apart(1/((1 + x)*(5 + x)))" , "1/(4+4*x)+1/(-20-4*x)" );
3331
+ check ("Apart(1/((1 + x)*(5 + x)))" , //
3332
+ "1/(4+4*x)-1/(20+4*x)" );
3333
3333
check ("Apart((x)/(x^2-1))" , "1/(-2+2*x)+1/(2+2*x)" );
3334
3334
check ("Apart((x+3)/(x^2-3*x-40))" , "11/(-104+13*x)+2/(65+13*x)" );
3335
3335
check ("Apart((10*x^2+12*x+20)/(x^3-8))" , "7/(-2+x)+(4+3*x)/(4+2*x+x^2)" );
3336
3336
check ("Apart((3*x+5)*(1-2*x)^(-2))" , "13/8*1/(1/2-x)^2+3/(-2+4*x)" );
3337
3337
check ("Apart((10*x^2+12*x+20)/(x^3-8))" , "7/(-2+x)+(4+3*x)/(4+2*x+x^2)" );
3338
3338
check ("Apart((10*x^2-63*x+29)/((x+2)*(x+3)^5))" ,
3339
- "195/(2+x)-308/(3+x)^5-185/(3+x)^4-195/(3+x)^3-195/(3+x)^2+ 195/(-3- x)" );
3339
+ "195/(2+x)-308/(3+x)^5-185/(3+x)^4-195/(3+x)^3-195/(3+x)^2- 195/(3+ x)" );
3340
3340
}
3341
3341
3342
3342
public void testSystem996 () {
@@ -3552,13 +3552,13 @@ public void testSystem1102() {
3552
3552
+ "{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },\n "
3553
3553
+ "{ 56.0, 4.0, 24.0, 56.0, 78.0, 0.0, 13.0, 0.0, 24.0, 57.0, 8.0, 1.0 },\n "
3554
3554
+ "{ 0.0, 0.0, 46.0, 666.0, 34.0, 13.0, 67.0, 9.0, 12.0, 45.0, 38.0, 0.0 }})" , //
3555
- "{{1.0,0.0,0.0,0.0,0.0,0.0,2.10208,0.880296,1.20494,2.02695,0.0532847,-0.0238165},\n " +
3556
- " {0.0,1.0,0.0,0.0,0.0,0.0,15.92647,11.96727,11.32597,8.52651,4.08647,-0.243999},\n " +
3557
- " {0.0,0.0,1.0,0.0,0.0,0.0,35.20901,22.34247,20.93462,20.96898,8.61046,-0.47866},\n " +
3558
- " {0.0,0.0,0.0,1.0,0.0,0.0,-0.273706,-0.238202,-0.880791,-0.17439,-0.130603,0.0150597},\n " +
3559
- " {0.0,0.0,0.0,0.0,1.0,0.0,-12.79629,-7.9493,-6.94727,-7.48852,-2.70086,0.1789},\n " +
3560
- " {0.0,0.0,0.0,0.0,0.0,1.0,-71.94246,-45.37189,-9.85987,-42.21689,-13.79002,0.454309},\n " +
3561
- " {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}" );
3555
+ "{{1.0,0.0,0.0,0.0,0.0,0.0,2.10208,0.880296,1.20494,2.02695,0.0532847,-0.0238165},\n "
3556
+ + " {0.0,1.0,0.0,0.0,0.0,0.0,15.92647,11.96727,11.32597,8.52651,4.08647,-0.243999},\n "
3557
+ + " {0.0,0.0,1.0,0.0,0.0,0.0,35.20901,22.34247,20.93462,20.96898,8.61046,-0.47866},\n "
3558
+ + " {0.0,0.0,0.0,1.0,0.0,0.0,-0.273706,-0.238202,-0.880791,-0.17439,-0.130603,0.0150597},\n "
3559
+ + " {0.0,0.0,0.0,0.0,1.0,0.0,-12.79629,-7.9493,-6.94727,-7.48852,-2.70086,0.1789},\n "
3560
+ + " {0.0,0.0,0.0,0.0,0.0,1.0,-71.94246,-45.37189,-9.85987,-42.21689,-13.79002,0.454309},\n "
3561
+ + " {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}}" );
3562
3562
3563
3563
check ("RowReduce({{ 0, 0, 0, 0 }})" , "{{0,0,0,0}}" );
3564
3564
check ("RowReduce({{ 0.0, 1.0, 0.0, 0.0 }})" , "{{0.0,1.0,0.0,0.0}}" );
@@ -3570,9 +3570,8 @@ public void testSystem1102() {
3570
3570
3571
3571
check ("RowReduce({{ 5.0, 7.0, 10.0, 3.0, 5.0, 8.0 },\n " + "{ 5.0, 2.0, 3.0, 10.0, 11.0, 9.0 },\n "
3572
3572
+ "{ 4.0, 3.0, 9.0, 12.0, 8.0, 9.0 }})" ,
3573
- "{{1.0,0.0,0.0,2.50862,2.67241,1.86207},\n " +
3574
- " {0.0,1.0,0.0,-3.19828,-1.46552,-0.827586},\n " +
3575
- " {0.0,0.0,1.0,1.28448,0.189655,0.448276}}" );
3573
+ "{{1.0,0.0,0.0,2.50862,2.67241,1.86207},\n " + " {0.0,1.0,0.0,-3.19828,-1.46552,-0.827586},\n "
3574
+ + " {0.0,0.0,1.0,1.28448,0.189655,0.448276}}" );
3576
3575
check ("RowReduce({{1,2,3},{4,5,6}})" , "{{1,0,-1},\n " + " {0,1,2}}" );
3577
3576
3578
3577
check ("RowReduce({{1,1,0,1,5},{1,0,0,2,2},{0,0,1,4,-1},{0,0,0,0,0}})" ,
@@ -3790,14 +3789,14 @@ public void testNCalcGithub42() {
3790
3789
check ("Together(1/(-3+x)-(2+x)/(3-x)^2)" , "-5/(9-6*x+x^2)" );
3791
3790
check ("Simplify(1/(-3+x)-(2+x)/(3-x)^2)" , "-5/(3-x)^2" );
3792
3791
}
3793
-
3794
- // public void testOutputformats() {
3795
- // check("{6.7^-4, 6.7^6, 6.7^8}", //
3796
- // "{0.0005,90458.38217,4.06067678*10^6}");
3797
- // check("{8.^5, 11.^7, 13.^9}", //
3798
- // "{32768.0,1.94871710*10^7,1.06044994*10^10}");
3799
- //
3800
- // checkNumeric("{6.7^-4, 6.7^6, 6.7^8}", //
3801
- // "{4.962503078612847E-4,90458.38216900002,4060676.7755664107}");
3802
- // }
3792
+
3793
+ // public void testOutputformats() {
3794
+ // check("{6.7^-4, 6.7^6, 6.7^8}", //
3795
+ // "{0.0005,90458.38217,4.06067678*10^6}");
3796
+ // check("{8.^5, 11.^7, 13.^9}", //
3797
+ // "{32768.0,1.94871710*10^7,1.06044994*10^10}");
3798
+ //
3799
+ // checkNumeric("{6.7^-4, 6.7^6, 6.7^8}", //
3800
+ // "{4.962503078612847E-4,90458.38216900002,4060676.7755664107}");
3801
+ // }
3803
3802
}
0 commit comments