11-> ; This is a Mathomatic script that reads in all test scripts. 21-> 31-> clear all 41-> ; Test simplifying trig functions: 51-> read trig.in 61-> ; Trigonometric functions as complex exponentials. 71-> ; Use m4 Mathomatic instead for easy entry of these trig functions. 81-> ; Based on Euler's identity: e^(i*x) = cos(x) + i*sin(x) 91-> ; Variable x is an angle in radians. 101-> 111-> ; Unity relationship: sin(x)^2 + cos(x)^2 = 1 121-> 131-> ; sin(x) (sine of x) = cos(pi/2 - x) 141-> sin=(e^(i*x)-e^(-i*x))/(2i) 15 16 ((e^(i*x)) - (e^(-i*x))) 17#1: sin = ------------------------ 18 (2*i) 19 201-> 211-> ; cos(x) (cosine of x) = sin(pi/2 - x) 221-> cos=(e^(i*x)+e^(-i*x))/2 23 24 ((e^(i*x)) + (e^(-i*x))) 25#2: cos = ------------------------ 26 2 27 282-> 292-> ; tan(x) (tangent of x) = sin(x)/cos(x) = cot(pi/2 - x) 302-> tan=(e^(i*x)-e^(-i*x))/(i*(e^(i*x)+e^(-i*x))) 31 32 ((e^(i*x)) - (e^(-i*x))) 33#3: tan = ---------------------------- 34 (i*((e^(i*x)) + (e^(-i*x)))) 35 363-> 373-> ; cot(x) (cotangent of x) = cos(x)/sin(x) = tan(pi/2 - x) 383-> cot=i*(e^(i*x)+e^(-i*x))/(e^(i*x)-e^(-i*x)) 39 40 i*((e^(i*x)) + (e^(-i*x))) 41#4: cot = -------------------------- 42 ((e^(i*x)) - (e^(-i*x))) 43 444-> 454-> ; sec(x) (secant of x) = 1/cos(x) = csc(pi/2 - x) 464-> sec=2/(e^(i*x)+e^(-i*x)) 47 48 2 49#5: sec = ------------------------ 50 ((e^(i*x)) + (e^(-i*x))) 51 525-> 535-> ; csc(x) (cosecant of x) = 1/sin(x) = sec(pi/2 - x) 545-> csc=2i/(e^(i*x)-e^(-i*x)) 55 56 2*i 57#6: csc = ------------------------ 58 ((e^(i*x)) - (e^(-i*x))) 59 60Successfully finished reading script file "trig.in". 616-> read hypertrig.in 626-> ; Definitions for hyperbolic trigonometry. 636-> ; Use m4 Mathomatic instead for easy entry of these hypertrig functions. 646-> ; Based on the identity cosh(x)^2-sinh(x)^2 = 1. 656-> 666-> ; sinh(x); hyperbolic sine of x 676-> sinh=(e^x-e^-x)/2 68 69 (e^x - (e^(-x))) 70#7: sinh = ---------------- 71 2 72 737-> 747-> ; cosh(x); hyperbolic cosine of x 757-> cosh=(e^x+e^-x)/2 76 77 (e^x + (e^(-x))) 78#8: cosh = ---------------- 79 2 80 818-> 828-> ; tanh(x); hyperbolic tangent of x 838-> tanh=(e^x-e^-x)/(e^x+e^-x) 84 85 (e^x - (e^(-x))) 86#9: tanh = ---------------- 87 (e^x + (e^(-x))) 88 899-> 909-> ; coth(x); hyperbolic cotangent of x 919-> coth=(e^x+e^-x)/(e^x-e^-x) 92 93 (e^x + (e^(-x))) 94#10: coth = ---------------- 95 (e^x - (e^(-x))) 96 9710-> 9810-> ; sech(x); hyperbolic secant of x 9910-> sech=2/(e^x+e^-x) 100 101 2 102#11: sech = ---------------- 103 (e^x + (e^(-x))) 104 10511-> 10611-> ; csch(x); hyperbolic cosecant of x 10711-> csch=2/(e^x-e^-x) 108 109 2 110#12: csch = ---------------- 111 (e^x - (e^(-x))) 112 113Successfully finished reading script file "hypertrig.in". 11412-> simplify all 115 116 1 117 i*(--------- - (e^(i*x))) 118 (e^(i*x)) 119#1: sin = ------------------------- 120 2 121 122 123 1 124 ((e^(i*x)) + ---------) 125 (e^(i*x)) 126#2: cos = ----------------------- 127 2 128 129 130 2 131#3: tan = i*(----------------- - 1) 132 ((e^(2*i*x)) + 1) 133 134 135 2 136#4: cot = i*(1 + -----------------) 137 ((e^(2*i*x)) - 1) 138 139 140 2*(e^(i*x)) 141#5: sec = ----------------- 142 ((e^(2*i*x)) + 1) 143 144 145 2*i*(e^(i*x)) 146#6: csc = ----------------- 147 ((e^(2*i*x)) - 1) 148 149 150 1 151 (e^x - ---) 152 e^x 153#7: sinh = ----------- 154 2 155 156 157 1 158 (e^x + ---) 159 e^x 160#8: cosh = ----------- 161 2 162 163 164 2 165#9: tanh = 1 - --------------- 166 ((e^(2*x)) + 1) 167 168 169 2 170#10: coth = 1 + --------------- 171 ((e^(2*x)) - 1) 172 173 174 2*e^x 175#11: sech = --------------- 176 ((e^(2*x)) + 1) 177 178 179 2*e^x 180#12: csch = --------------- 181 ((e^(2*x)) - 1) 182 18312-> simplify frac all 184 185 1 186 i*(--------- - (e^(i*x))) 187 (e^(i*x)) 188#1: sin = ------------------------- 189 2 190 191 192 1 193 ((e^(i*x)) + ---------) 194 (e^(i*x)) 195#2: cos = ----------------------- 196 2 197 198 199 i*(1 - (e^(2*i*x))) 200#3: tan = ------------------- 201 ((e^(2*i*x)) + 1) 202 203 204 i*((e^(2*i*x)) + 1) 205#4: cot = ------------------- 206 ((e^(2*i*x)) - 1) 207 208 209 2*(e^(i*x)) 210#5: sec = ----------------- 211 ((e^(2*i*x)) + 1) 212 213 214 2*i*(e^(i*x)) 215#6: csc = ----------------- 216 ((e^(2*i*x)) - 1) 217 218 219 1 220 (e^x - ---) 221 e^x 222#7: sinh = ----------- 223 2 224 225 226 1 227 (e^x + ---) 228 e^x 229#8: cosh = ----------- 230 2 231 232 233 ((e^(2*x)) - 1) 234#9: tanh = --------------- 235 ((e^(2*x)) + 1) 236 237 238 ((e^(2*x)) + 1) 239#10: coth = --------------- 240 ((e^(2*x)) - 1) 241 242 243 2*e^x 244#11: sech = --------------- 245 ((e^(2*x)) + 1) 246 247 248 2*e^x 249#12: csch = --------------- 250 ((e^(2*x)) - 1) 251 25212-> ; Let's simplify some trig identities without using m4: 25312-> sin^2+cos^2=1 254 255#13: sin^2 + cos^2 = 1 256 25713-> elim all 258Eliminating variable cos using solved equation #2... 259Eliminating variable sin using solved equation #1... 260 261 1 1 262 i*(--------- - (e^(i*x))) ((e^(i*x)) + ---------) 263 (e^(i*x)) (e^(i*x)) 264#13: (-------------------------^2) + (-----------------------^2) = 1 265 2 2 266 26713-> simplify 268 269#13: 1 = 1 270 27113-> tan=sin/cos 272 273 sin 274#14: tan = --- 275 cos 276 27714-> elim all 278Eliminating variable tan using solved equation #3... 279Eliminating variable cos using solved equation #2... 280Eliminating variable sin using solved equation #1... 281 282 1 283 i*(--------- - (e^(i*x))) 284 i*(1 - (e^(2*i*x))) (e^(i*x)) 285#14: ------------------- = ------------------------- 286 ((e^(2*i*x)) + 1) 1 287 ((e^(i*x)) + ---------) 288 (e^(i*x)) 289 29014-> csc=1/sin 291 292 1 293#15: csc = --- 294 sin 295 29615-> elim all 297Eliminating variable csc using solved equation #6... 298Eliminating variable sin using solved equation #1... 299 300 2*i*(e^(i*x)) 2 301#15: ----------------- = --------------------------- 302 ((e^(2*i*x)) - 1) 1 303 (i*(--------- - (e^(i*x)))) 304 (e^(i*x)) 305 30615-> sec=1/cos 307 308 1 309#16: sec = --- 310 cos 311 31216-> elim all 313Eliminating variable sec using solved equation #5... 314Eliminating variable cos using solved equation #2... 315 316 2*(e^(i*x)) 2 317#16: ----------------- = ----------------------- 318 ((e^(2*i*x)) + 1) 1 319 ((e^(i*x)) + ---------) 320 (e^(i*x)) 321 32216-> cot=1/tan 323 324 1 325#17: cot = --- 326 tan 327 32817-> elim all 329Eliminating variable cot using solved equation #4... 330Eliminating variable tan using solved equation #3... 331 332 i*((e^(2*i*x)) + 1) ((e^(2*i*x)) + 1) 333#17: ------------------- = --------------------- 334 ((e^(2*i*x)) - 1) (i*(1 - (e^(2*i*x)))) 335 33617-> 1+tan^2=sec^2 337 338#18: 1 + tan^2 = sec^2 339 34018-> elim all 341Eliminating variable sec using solved equation #5... 342Eliminating variable tan using solved equation #3... 343 344 i*(1 - (e^(2*i*x))) 2*(e^(i*x)) 345#18: 1 + (-------------------^2) = -----------------^2 346 ((e^(2*i*x)) + 1) ((e^(2*i*x)) + 1) 347 34818-> cosh^2-sinh^2=1 ; The main hyperbolic trigonometry identity: 349 350#19: cosh^2 - sinh^2 = 1 351 35219-> elim all 353Eliminating variable cosh using solved equation #8... 354Eliminating variable sinh using solved equation #7... 355 356 1 1 357 (e^x + ---) (e^x - ---) 358 e^x e^x 359#19: (-----------^2) - (-----------^2) = 1 360 2 2 361 36219-> ; Now verify them all, to show and check the new solve command usage. 36319-> solve 13-19 verifiable 0 364Solving equation #13 for 0 with required identity verification... 365Solve and "repeat simplify quick" successful: 366 367#13: 0 = 0 368 369This equation is an identity. 370Solving equation #14 for 0 with required identity verification... 371Solve and "repeat simplify quick" successful: 372 373#14: 0 = 0 374 375This equation is an identity. 376Solving equation #15 for 0 with required identity verification... 377Solve and "repeat simplify quick" successful: 378 379#15: 0 = 0 380 381This equation is an identity. 382Solving equation #16 for 0 with required identity verification... 383Solve and "repeat simplify quick" successful: 384 385#16: 0 = 0 386 387This equation is an identity. 388Solving equation #17 for 0 with required identity verification... 389Solve and "repeat simplify quick" successful: 390 391#17: 0 = 0 392 393This equation is an identity. 394Solving equation #18 for 0 with required identity verification... 395Solve and "repeat simplify quick" successful: 396 397#18: 0 = (4*(e^(2*i*x))) - (((e^(2*i*x)) + 1)^2) + ((1 - (e^(2*i*x)))^2) 398 399This equation is an identity. 400Solving equation #19 for 0 with required identity verification... 401Solve and "repeat simplify quick" successful: 402 403#19: 0 = (4*(e^(2*x))) + (((e^(2*x)) - 1)^2) - (((e^(2*x)) + 1)^2) 404 405This equation is an identity. 40619-> pause 40719-> clear all 4081-> ; Next, test fixed-point mode and some financial equations: 4091-> read finance 4101-> 4111-> ; Combine 2 commonly used formulas to produce the mortgage payment formula. 4121-> ; Here are 3 related financial formulas that can be "read" into Mathomatic. 4131-> 4141-> set fixed ; Enable fixed-point money mode; rounds to the nearest cent. 415Success. 4161-> ; First, the variable definitions: 4171-> ; pv = present value 4181-> ; fv = future value (maturity value) 4191-> ; interest_rate = interest rate per period (1 = 100%) 4201-> ; n = number of periods 4211-> 4221-> ; Compound Interest Future Value Formula: 4231-> fv1 = pv*(1+interest_rate)^n 424 425#1: fv1 = pv*((1.00 + interest_rate)^n) 426 4271-> ; Future Value Annuity Formula: 4281-> fv2 = payment*(((1+interest_rate)^n-1)/interest_rate) 429 430 payment*(((1.00 + interest_rate)^n) - 1.00) 431#2: fv2 = ------------------------------------------- 432 interest_rate 433 4342-> ; Next we will combine these to produce the standard annuity formula. 4352-> ; Set equal, then solve and simplify: 4362-> fv1 = fv2 437 438#3: fv1 = fv2 439 4403-> pause 4413-> eliminate all ; combine both formulas to produce the annuity formula: 442Eliminating variable fv2 using solved equation #2... 443Eliminating variable fv1 using solved equation #1... 444 445 payment*(((1.00 + interest_rate)^n) - 1.00) 446#3: pv*((1.00 + interest_rate)^n) = ------------------------------------------- 447 interest_rate 448 4493-> solve verifiable pv ; solve for present value: 450Solving equation #3 for pv with required verification... 451Solve and "repeat simplify quick" successful: 452 453 1.00 454 payment*(1.00 - --------------------------) 455 ((1.00 + interest_rate)^n) 456#3: pv = ------------------------------------------- 457 interest_rate 458 459Solution verified. 4603-> solve verifiable payment ; or solve for payment per period: 461Solving equation #3 for payment with required verification... 462Solve and "repeat simplify quick" successful: 463 464 pv*((1.00 + interest_rate)^n)*interest_rate 465#3: payment = ------------------------------------------- 466 (((1.00 + interest_rate)^n) - 1.00) 467 468Solution verified. 4693-> pause End of finance tutorial 4703-> ; Remember we are still in fixed-point money mode, 4713-> ; unless you typed "set no fixed". 472Successfully finished reading script file "finance.in". 4733-> a=55/-3 474 475 (-55.00) 476#4: a = -------- 477 3.00 478 4794-> list 480#4: a = (-55.00)/3.00 4814-> display mixed 482 483 1.00 484#4: a = -(18.00 + ----) 485 3.00 486 4874-> display mixed factor 488 489 1.00 490#4: a = -((2.00*3.00^2.00) + ----) 491 3.00 492 4934-> display simple 494 495 (-55.00) 496#4: a = -------- 497 3.00 498 4994-> list 500#4: a = (-55.00)/3.00 5014-> display 502 503 (-55.00) 504#4: a = -------- 505 3.00 506 5074-> set no fixed_point 508Success. 5094-> display 510 511 -55 512#4: a = --- 513 3 514 5154-> clear all 5161-> read quadratic 5171-> 5181-> ; General quadratic (2nd degree polynomial) formula. 5191-> ; Formula for the 2 roots (solutions for x) 5201-> ; of the general quadratic equation. 5211-> ; 5221-> a x^2 + b x + c = 0 ; The general quadratic equation. 523 524#1: (a*x^2) + (b*x) + c = 0 525 5261-> copy select ; Make a copy and select it. 527 528#2: (a*x^2) + (b*x) + c = 0 529 5302-> solve verifiable for x ; Mathomatic can easily solve and verify that: 531Solving equation #2 for x with required verification... 532Equation is a degree 2 polynomial equation in x. 533Equation was solved with the quadratic formula. 534Solve and "repeat simplify quick" successful: 535 536 1 537 ((((b^2 - (4*a*c))^-)*sign) - b) 538 2 539#2: x = -------------------------------- 540 (2*a) 541 542All solutions verified. 5432-> ; This is the quadratic formula. 5442-> ; The coefficients (a, b, and c) may be any mathematical expression not containing x. 5452-> pause 5462-> ; Here is the derivation and proof of the quadratic formula, 5472-> ; without actually using the quadratic formula, 5482-> ; because that is what we are trying to derive now, from the quadratic equation: 5492-> #1: 550 551#1: (a*x^2) + (b*x) + c = 0 552 5531-> copy select ; make a copy of the general quadratic equation to work on and select it. 554 555#3: (a*x^2) + (b*x) + c = 0 556 5573-> -=c ; subtract "c" from both sides. 558 559#3: (a*x^2) + (b*x) = -c 560 5613-> /=a ; divide both sides by "a". 562 563 ((a*x^2) + (b*x)) -c 564#3: ----------------- = -- 565 a a 566 5673-> pause Next simplify it and turn it into a repeated factor polynomial equation 5683-> simplify 569 570 x*b -c 571#3: x^2 + --- = -- 572 a a 573 5743-> +=b^2/(4*(a^2)) ; add "b^2/(4*(a^2))" to both sides. 575 576 x*b b^2 b^2 c 577#3: x^2 + --- + ------- = ------- - - 578 a (4*a^2) (4*a^2) a 579 5803-> ; Now the LHS is a repeated factor polynomial, next factor it by pressing Enter to simplify. 5813-> pause 5823-> simplify ; Now the LHS is a factored polynomial, so solving for the single "x" is easy. 583 584 b b 585 (((2*x) + -)^2) (-^2) 586 a a c 587#3: --------------- = ----- - - 588 4 4 a 589 5903-> set debug 1 ; Let Mathomatic do the work and show it too. 591Success. 5923-> ; Show how easy it is to solve this equation now, after pressing Enter. 5933-> pause 5943-> x 595level 1: 0.25*(((2*x) + (b/a))^2) = ((0.25*b^2) - (c*a))/a^2 596Dividing both sides of the equation by "0.25": 597level 1: ((2*x) + (b/a))^2 = 4*((0.25*b^2) - (c*a))/a^2 598Raising both sides of the equation to the power of 0.5: 599level 1: (2*x) + (b/a) = ((4*((0.25*b^2) - (c*a))/a^2)^0.5)*sign0 600Subtracting "b/a" from both sides of the equation: 601level 1: 2*x = (((4*((0.25*b^2) - (c*a))/a^2)^0.5)*sign0) - (b/a) 602Dividing both sides of the equation by "2": 603level 1: x = 0.5*((((4*((0.25*b^2) - (c*a))/a^2)^0.5)*sign0) - (b/a)) 604Solve completed: 605level 1: x = 0.5*((((4*((0.25*b^2) - (c*a))/a^2)^0.5)*sign0) - (b/a)) 606Solve successful: 607 608 b^2 609 4*(--- - (c*a)) 610 4 1 b 611 (((---------------^-)*sign0) - -) 612 a^2 2 a 613#3: x = --------------------------------- 614 2 615 6163-> ; Here is the raw solve result, press the Enter key to simplify and compare with the quadratic formula. 6173-> pause 6183-> set no debug 619Success. 6203-> repeat simplify 621 622 1 623 ((((b^2 - (4*c*a))^-)*sign0) - b) 624 2 625#3: x = --------------------------------- 626 (2*a) 627 6283-> compare with 2 629Comparing #2 with #3... 630Equations are identical. 6313-> 632Successfully finished reading script file "quadratic.in". 6333-> clear all 6341-> read electronics 6351-> 6361-> ; General electrical formulas: 6371-> 6381-> volts=amps*ohms ; Ohm's Law, commonly solved for resistance (ohms) or current (amps). 639 640#1: volts = amps*ohms 641 6421-> watts=volts*amps ; Power Law 643 644#2: watts = volts*amps 645 6462-> 1/r=1/r1+1/r2 ; Resistance (r) of 2 resistors (r1 and r2) wired in parallel. 647 648 1 1 1 649#3: - = -- + -- 650 r r1 r2 651 6523-> solve verifiable r ; Solve for the resulting resistance. 653Solving equation #3 for r with required verification... 654Solve and "repeat simplify quick" successful: 655 656 r1*r2 657#3: r = --------- 658 (r2 + r1) 659 660Solution verified. 6613-> 1/r=1/r1+1/r2+1/r3 ; Resistance (r) of 3 resistors wired in parallel. 662 663 1 1 1 1 664#4: - = -- + -- + -- 665 r r1 r2 r3 666 6674-> solve verifiable r ; Solve for the resulting resistance. 668Solving equation #4 for r with required verification... 669Solve and "repeat simplify quick" successful: 670 671 r1*r2*r3 672#4: r = -------------------------- 673 ((r3*r2) + (r1*(r3 + r2))) 674 675Solution verified. 6764-> frequency=1/(2*pi*(L*C)^.5) ; Resonant frequency of an LC circuit in hertz. 677 678 1 679#5: frequency = ---------------- 680 1 681 (2*pi*((L*C)^-)) 682 2 683 6845-> ; L is the inductance in henries, and C is the capacitance in farads. 685Successfully finished reading script file "electronics.in". 6865-> simplify all 687 688#1: volts = amps*ohms 689 690 691#2: watts = volts*amps 692 693 694 r1*r2 695#3: r = --------- 696 (r2 + r1) 697 698 699 r1*r2*r3 700#4: r = -------------------------- 701 ((r3*r2) + (r1*(r3 + r2))) 702 703 704 1 705#5: frequency = ---------------- 706 1 707 (2*pi*((L*C)^-)) 708 2 709 7105-> clear all 7111-> read fibonacci 7121-> 7131-> ; This Mathomatic input file contains the mathematical formula to 7141-> ; directly calculate the "n"th Fibonacci number. 7151-> ; The formula presented here is called Binet's formula, found at 7161-> ; http://en.wikipedia.org/wiki/Fibonacci_number 7171-> ; 7181-> ; The Fibonacci sequence is the endless integer sequence: 7191-> ; 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 ... 7201-> ; Any Fibonacci number is always the sum of the previous two Fibonacci numbers. 7211-> ; 7221-> ; Easy to understand info on the golden ratio can be found here: 7231-> ; http://www.mathsisfun.com/numbers/golden-ratio.html 7241-> 7251-> -1/phi=1-phi ; Derive the golden ratio (phi) from this quadratic polynomial. 726 727 -1 728#1: --- = 1 - phi 729 phi 730 7311-> 0 ; show it is quadratic 732Solve successful: 733 734#1: 0 = ((1 - phi)*phi) + 1 735 7361-> unfactor 737 738#1: 0 = phi - phi^2 + 1 739 7401-> solve verifiable for phi ; The golden ratio will help us directly compute Fibonacci numbers. 741Solving equation #1 for phi with required verification... 742Equation is a degree 2 polynomial equation in phi. 743Equation was solved with the quadratic formula. 744Solve and "repeat simplify quick" successful: 745 746 1 747 (1 - ((5^-)*sign)) 748 2 749#1: phi = ------------------ 750 2 751 752All solutions verified. 7531-> replace sign with -1 ; the golden ratio constant: 754 755 1 756 (1 + (5^-)) 757 2 758#1: phi = ----------- 759 2 760 7611-> fibonacci = ((phi^n) - ((1 - phi)^n))/(phi - (1 - phi)) ; Binet's Fibonacci formula. 762 763 (phi^n - ((1 - phi)^n)) 764#2: fibonacci = ----------------------- 765 (phi - 1 + phi) 766 7672-> eliminate phi ; Completed direct Fibonacci formula: 768Eliminating variable phi using solved equation #1... 769 770 1 1 771 (1 + (5^-)) (1 + (5^-)) 772 2 2 773 ((-----------^n) - ((1 - -----------)^n)) 774 2 2 775#2: fibonacci = ----------------------------------------- 776 1 777 (5^-) 778 2 779 7802-> simplify ; Note that Mathomatic rationalizes the denominator here. 781 782 1 1 1 783 (5^-)*(((1 + (5^-))^n) - ((1 - (5^-))^n)) 784 2 2 2 785#2: fibonacci = ----------------------------------------- 786 (5*2^n) 787 7882-> for n 1 20 ; Display the first 20 Fibonacci numbers by plugging in values 1-20: 789n = 1: 1 790n = 2: 1 791n = 3: 2 792n = 4: 3 793n = 5: 5 794n = 6: 8 795n = 7: 13 796n = 8: 21 797n = 9: 34 798n = 10: 55 799n = 11: 89 800n = 12: 144 801n = 13: 233 802n = 14: 377 803n = 15: 610 804n = 16: 987 805n = 17: 1597 806n = 18: 2584 807n = 19: 4181 808n = 20: 6765 8092-> ; Note that this formula should work for any positive integer value of n. 810Successfully finished reading script file "fibonacci.in". 8112-> clear all 8121-> read test 8131-> ; Read in some of the things previously fixed in Mathomatic. 8141-> read fix1 8151-> clear all 8161-> y = (((((a+b)/(b-c))^0.25)+(((b-c)/(a+b))^0.25)+(((a-b)*i/(b-c))^0.5))*(i^0.5))^(1/n) 817 818 (a + b) 1 (b - c) 1 (a - b)*i 1 1 1 819#1: y = (((-------^-) + (-------^-) + (---------^-))*(i^-))^- 820 (b - c) 4 (a + b) 4 (b - c) 2 2 n 821 8221-> y = (a^a)*(1+(((a^(a^2))*(b^a))^(1/(1-a)))) 823 824 1 825#2: y = a^a*(1 + (((a^(a^2))*b^a)^-------)) 826 (1 - a) 827 8282-> y = (a^2)*(1+(((a^(2*((1.5*a)-1)))*(b^a))^(1/(1-a)))) 829 830 3*a 1 831#3: y = a^2*(1 + (((a^(2*(--- - 1)))*b^a)^-------)) 832 2 (1 - a) 833 8343-> y = (15*(d^2)/((1+(d^2))^(7/2)))-(12/((1+(d^2))^(5/2)))-6 835 836 15*d^2 12 837#4: y = ------------- - ------------- - 6 838 7 5 839 ((1 + d^2)^-) ((1 + d^2)^-) 840 2 2 841 8424-> y = ((9 + (32^.5))^.5) ; should simplify to (1 + 2*(2^.5)) someday 843 844 1 1 845#5: y = (9 + (32^-))^- 846 2 2 847 8485-> simplify symbolic all 849 850 (b + a) 1 (c - b) 1 (a - b) 1 1 851#1: y = ((-------^-) + (-------^-) + (-------^-))^- 852 (c - b) 4 (a + b) 4 (c - b) 2 n 853 854 855 a 856#2: y = a^a + ((a*b)^-------) 857 (1 - a) 858 859 860 a 861#3: y = a^2 + ((a*b)^-------) 862 (1 - a) 863 864 865 (d^2 - 4) 866#4: y = 3*(------------- - 2) 867 7 868 ((1 + d^2)^-) 869 2 870 871 872 1 1 873#5: y = (9 + (4*(2^-)))^- 874 2 2 875 8765-> simplify all 877 878 (b + a) 1 (c - b) 1 (a - b) 1 1 879#1: y = ((-------^-) + (-------^-) + (-------^-))^- 880 (c - b) 4 (a + b) 4 (c - b) 2 n 881 882 883 a 884#2: y = a^a + ((a*b)^-------) 885 (1 - a) 886 887 888 a 889#3: y = a^2 + ((a*b)^-------) 890 (1 - a) 891 892 893 (d^2 - 4) 894#4: y = 3*(------------- - 2) 895 7 896 ((1 + d^2)^-) 897 2 898 899 900 1 1 901#5: y = (9 + (4*(2^-)))^- 902 2 2 903 9045-> x^2=|x| 905 906 1 907#6: x^2 = (x^2)^- 908 2 909 9106-> solve for x 911Equation is a degree 2 polynomial equation in x. 912Raising both equation sides to the power of 2 and expanding... 913Equation is a degree 3 polynomial equation in x. 914Removing possible solution: "x = 0". 915Solve successful: 916 917#6: x = sign 918 9196-> x^(1/99)=x 920 921 1 922#7: x^-- = x 923 99 924 9257-> solve verifiable x 926Solving equation #7 for x with required verification... 927Equation is a degree 0.01010101010101 polynomial equation in x. 928Raising both equation sides to the power of 99 and expanding... 929Equation is a degree 99 polynomial equation in x. 930Removing possible solution: "x = 0". 931Solve and "repeat simplify quick" successful: 932 933#7: x = sign0 934 935All solutions verified. 9367-> (2i)^.5+e^(pi*i) 937Calculating... 938 answer = i 9398-> (1-2i)/(3+4i) 940Calculating... 941 answer = (-0.4*i) - 0.2, with fractions it is: (-2*i/5) - (1/5) 9429-> divide (1-2i) (3+4i) 943 944Result of complex number division: 945-0.2 -0.4*i 946 9479-> 9489-> y=x^3 949 950#10: y = x^3 951 95210-> extrema x 953 954#11: x = 0 955 95611-> (x+1)^4 957 958#12: (x + 1)^4 959 96012-> extrema x 961 962#13: x = -1 963 96413-> roots 4 1 0 ; The 4 roots of unity. 965 966The polar coordinates are: 9671 amplitude and 9680 radians (0 degrees). 969 970The 4 roots of (1)^(1/4) are: 971 9721 973+1*i 974-1 975-1*i 97613-> factor number -75 100000000000000 16! 7921%14 ; should be exactly 11 977-75 = 3 * 5^2 * -1 978100000000000000 = 2^14 * 5^14 97920922789888000 = 2^15 * 3^6 * 5^3 * 7^2 * 11 * 13 980Prime number: 11 = 11 981Successfully finished reading script file "fix1.in". 98213-> read fix2 98313-> clear all 9841-> b = ((-1)^(1/((-1*n)+1)*(2+n)))*(a^(1/((-1*n)+1))) 985 986 (2 + n) 1 987#1: b = ((-1)^-------)*(a^-------) 988 (1 - n) (1 - n) 989 9901-> x = 1/(y^(1/(n-1)*(-2+n)))/((n^(n/(n-1)))-(n^(1/(n-1)))) 991 992 1 993#2: x = ----------------------------------------- 994 (n - 2) n 1 995 ((y^-------)*((n^-------) - (n^-------))) 996 (n - 1) (n - 1) (n - 1) 997 9982-> y = (x+(((1/x)+1)*((x^m)+((a+b)/(x^n)/(c+d)))))/(x+1) 999 1000 1 (a + b) 1001 (x + ((- + 1)*(x^m + -------------))) 1002 x (x^n*(c + d)) 1003#3: y = ------------------------------------- 1004 (x + 1) 1005 10063-> y = 3 / (x^3+3x^2-x-3) - 2 / (x^3-x^2-3x+3) + 4 / (x^3+x^2-3x-3) 1007 1008 3 2 4 1009#4: y = ----------------------- - ----------------------- + ----------------------- 1010 (x^3 + (3*x^2) - x - 3) (x^3 - x^2 - (3*x) + 3) (x^3 + x^2 - (3*x) - 3) 1011 10124-> (x^2 - 1)^4/(x + 1)^2 1013 1014 ((x^2 - 1)^4) 1015#5: ------------- 1016 ((x + 1)^2) 1017 10185-> simplify all 1019 1020 1 1021#1: b = ((-1)^n*a)^------- 1022 (1 - n) 1023 1024 1025 (2 - n) 1026 (y^-------) 1027 (n - 1) 1028#2: x = --------------------------- 1029 n 1 1030 ((n^-------) - (n^-------)) 1031 (n - 1) (n - 1) 1032 1033 1034 (b + a)*(1 + x) 1035 (x^2 + ---------------) 1036 (x^n*(c + d)) 1037#3: y = (x^(m - 1)) + ----------------------- 1038 (x^2 + x) 1039 1040 1041 (27 - (5*x^2)) 1042#4: y = ---------------------------------------------- 1043 ((4*x^3) - x^5 + (12*x^2) - (3*(x^4 + x)) - 9) 1044 1045 1046#5: ((1 + x)^2)*((x - 1)^4) 1047 10485-> 1 1049 1050 1 1051#1: b = ((-1)^n*a)^------- 1052 (1 - n) 1053 10541-> solve verifiable a 1055Solving equation #1 for a with required verification... 1056Solve and "repeat simplify quick" successful: 1057 1058 (b^(1 - n)) 1059#1: a = ----------- 1060 (-1)^n 1061 1062Solution verified. 10631-> 2 1064 1065 (2 - n) 1066 (y^-------) 1067 (n - 1) 1068#2: x = --------------------------- 1069 n 1 1070 ((n^-------) - (n^-------)) 1071 (n - 1) (n - 1) 1072 10732-> solve verifiable y 1074Solving equation #2 for y with required verification... 1075Solve and "repeat simplify quick" successful: 1076 1077 1 1078#2: y = (((x*(n - 1))^(n - 1))*n)^------- 1079 (2 - n) 1080 1081Solution verified. 10822-> 1/(x+y) 1083 1084 1 1085#6: ------- 1086 (x + y) 1087 10886-> taylor x, 5, 0 1089Taylor series with respect to x, simplified... 10905 non-zero derivatives applied. 1091 1092 1 x x^2 x^3 x^4 x^5 1093#7: - - --- + --- - --- + --- - --- 1094 y y^2 y^3 y^4 y^5 y^6 1095 10967-> fraction 1097 1098 (y^5 + (x^2*y^3) + (x^4*y) - x^5 - (x^3*y^2) - (x*y^4)) 1099#7: ------------------------------------------------------- 1100 y^6 1101 11027-> simplify fraction 1103 1104 (y^5 - (y^4*x) + (y^3*x^2) - (y^2*x^3) + (y*x^4) - x^5) 1105#7: ------------------------------------------------------- 1106 y^6 1107 11087-> simplify 1109 1110 x^5 1111 (x^4 - ---) 1112 y 1113 (----------- - x^3) 1114 y 1115 (x^2 + -------------------) 1116 y 1117 (--------------------------- - x) 1118 y 1119 (1 + ---------------------------------) 1120 y 1121#7: --------------------------------------- 1122 y 1123 1124Successfully finished reading script file "fix2.in". 11257-> read fix5 11267-> clear all 11271-> a = (x+1/2^.5)^3 1128 1129 1 1130#1: a = (x + -----)^3 1131 1 1132 (2^-) 1133 2 1134 11351-> a = (b+((c+1)^0.5))^3 1136 1137 1 1138#2: a = (b + ((c + 1)^-))^3 1139 2 1140 11412-> a = b*c*x*((((x^2)*c)+(b^4))^3)*(x+c) 1142 1143#3: a = b*c*x*(((x^2*c) + b^4)^3)*(x + c) 1144 11453-> a = (((b^2)+x)^3)*((1/x)+x)*b 1146 1147 1 1148#4: a = ((b^2 + x)^3)*(- + x)*b 1149 x 1150 11514-> a = b*(((1/b)+(1/c))^3) 1152 1153 1 1 1154#5: a = b*((- + -)^3) 1155 b c 1156 11575-> a = (b^2)*(((1/b)+(1/c))^3) 1158 1159 1 1 1160#6: a = b^2*((- + -)^3) 1161 b c 1162 11636-> a = (b^2)*((b-c)^3) 1164 1165#7: a = b^2*((b - c)^3) 1166 11677-> simplify all 1168 1169 1 1170 (((2*x) + (2^-))^3) 1171 2 1172#1: a = ------------------- 1173 8 1174 1175 1176 1 1177#2: a = (b + ((c + 1)^-))^3 1178 2 1179 1180 1181#3: a = ((b^4 + (c*x^2))^3)*b*((c*x^2) + (c^2*x)) 1182 1183 1184 1 1185#4: a = ((b^2 + x)^3)*b*(- + x) 1186 x 1187 1188 1189 1 1 1190#5: a = ((- + -)^3)*b 1191 c b 1192 1193 1194 b 1195 ((1 + -)^3) 1196 c 1197#6: a = ----------- 1198 b 1199 1200 1201#7: a = b^2*((b - c)^3) 1202 1203Successfully finished reading script file "fix5.in". 12047-> read fix7 12057-> ; Algebraic fractions test 12067-> clear all 12071-> (c+a-b)/(b-a) 1208 1209 (c + a - b) 1210#1: ----------- 1211 (b - a) 1212 12131-> ((d*(b+c))+(a*(e1+f)))/(e1+f)/(b+c) 1214 1215 ((d*(b + c)) + (a*(e1 + f))) 1216#2: ---------------------------- 1217 ((e1 + f)*(b + c)) 1218 12192-> ((((e1^2)+d)*b*((b^2)+2))-e1-f)/b/((b^2)+2)/(e1+f) 1220 1221 (((e1^2 + d)*b*(b^2 + 2)) - e1 - f) 1222#3: ----------------------------------- 1223 (b*(b^2 + 2)*(e1 + f)) 1224 12253-> ((b*((((e1^2)+d)*((b^2)+2))+(b*(e1+f))))+e1+f)/(e1+f)/b/((b^2)+2) 1226 1227 ((b*(((e1^2 + d)*(b^2 + 2)) + (b*(e1 + f)))) + e1 + f) 1228#4: ------------------------------------------------------ 1229 ((e1 + f)*b*(b^2 + 2)) 1230 12314-> ((1/(x^(1+n)))+(1/(x^n))+(x^(m-1))+(x^m)+x)/(x+1) 1232 1233 1 1 1234 (----------- + --- + (x^(m - 1)) + x^m + x) 1235 (x^(1 + n)) x^n 1236#5: ------------------------------------------- 1237 (x + 1) 1238 12395-> (1/(a + b)) + (1/(b + c)) 1240 1241 1 1 1242#6: ------- + ------- 1243 (a + b) (b + c) 1244 12456-> ((x - 1)^2)*(2 + x)/((1 + x)*((x - 3)^2)) 1246 1247 ((x - 1)^2)*(2 + x) 1248#7: --------------------- 1249 ((1 + x)*((x - 3)^2)) 1250 12517-> simplify all 1252 1253 c 1254#1: ------- - 1 1255 (b - a) 1256 1257 1258 d a 1259#2: -------- + ------- 1260 (e1 + f) (b + c) 1261 1262 1263 (d + e1^2) 1 1264#3: ---------- - ------------- 1265 (e1 + f) (b^3 + (2*b)) 1266 1267 1268 (d + e1^2) (1 + b^2) 1269#4: ---------- + ------------- 1270 (e1 + f) (b^3 + (2*b)) 1271 1272 1273 1 1274 (x^m + ---) 1275 x^n x 1276#5: ----------- + ------- 1277 x (x + 1) 1278 1279 1280 1 1 1281#6: ------- + ------- 1282 (b + c) (b + a) 1283 1284 1285 (1 - x) 1286 (-------^2)*(2 + x) 1287 (3 - x) 1288#7: ------------------- 1289 (1 + x) 1290 12917-> fraction all 1292 1293 (c - b + a) 1294#1: ----------- 1295 (b - a) 1296 1297 1298 ((d*(b + c)) + (a*(e1 + f))) 1299#2: ---------------------------- 1300 ((c + b)*(e1 + f)) 1301 1302 1303 (((d + e1^2)*(b^3 + (2*b))) - e1 - f) 1304#3: ------------------------------------- 1305 (((2*b) + b^3)*(e1 + f)) 1306 1307 1308 (((d + e1^2)*(b^3 + (2*b))) + e1 + f + (b^2*(e1 + f))) 1309#4: ------------------------------------------------------ 1310 (((2*b) + b^3)*(e1 + f)) 1311 1312 1313 ((x^n*((x^m*(x + 1)) + x^2)) + x + 1) 1314#5: ------------------------------------- 1315 (x^n*(x^2 + x)) 1316 1317 1318 ((2*b) + a + c) 1319#6: ----------------- 1320 ((b + c)*(b + a)) 1321 1322 1323 (2 + x)*((1 - x)^2) 1324#7: --------------------- 1325 ((1 + x)*((3 - x)^2)) 1326 13277-> simplify fraction all 1328 1329 (c - b + a) 1330#1: ----------- 1331 (b - a) 1332 1333 1334 ((d*(b + c)) + (a*(e1 + f))) 1335#2: ---------------------------- 1336 ((e1 + f)*(c + b)) 1337 1338 1339 (((d + e1^2)*(b^3 + (2*b))) - e1 - f) 1340#3: ------------------------------------- 1341 ((e1 + f)*((2*b) + b^3)) 1342 1343 1344 (((d + e1^2)*(b^3 + (2*b))) + (b^2*(e1 + f)) + e1 + f) 1345#4: ------------------------------------------------------ 1346 ((e1 + f)*((2*b) + b^3)) 1347 1348 1349 1 1350 (x^m + ---) 1351 x^n 1 1352 (x^m + ----------- + --- + x) 1353 x x^n 1354#5: ----------------------------- 1355 (x + 1) 1356 1357 1358 ((2*b) + a + c) 1359#6: ----------------- 1360 ((b + c)*(b + a)) 1361 1362 1363 ((1 - x)^2)*(2 + x) 1364#7: --------------------- 1365 (((3 - x)^2)*(1 + x)) 1366 13677-> simplify all 1368 1369 c 1370#1: ------- - 1 1371 (b - a) 1372 1373 1374 d a 1375#2: -------- + ------- 1376 (e1 + f) (c + b) 1377 1378 1379 (d + e1^2) 1 1380#3: ---------- - ------------- 1381 (e1 + f) ((2*b) + b^3) 1382 1383 1384 (d + e1^2) (1 + b^2) 1385#4: ---------- + ------------- 1386 (e1 + f) ((2*b) + b^3) 1387 1388 1389 1 1390 (x^m + ---) 1391 x^n x 1392#5: ----------- + ------- 1393 x (x + 1) 1394 1395 1396 1 1 1397#6: ------- + ------- 1398 (b + c) (b + a) 1399 1400 1401 (1 - x) 1402 (-------^2)*(2 + x) 1403 (3 - x) 1404#7: ------------------- 1405 (1 + x) 1406 1407Successfully finished reading script file "fix7.in". 14087-> read fix8 14097-> clear all 14101-> a = (((b^2)*(x^2))+(4*(b^2)*x)+(b^2)+(2*(b^3)*x)+(2*(b^3))+(b^4)+(2*b*(x^2))+(2*b*x)+(x^2))/(((b^3)*(x^2))+(2*(b^4)*x)+(b^5)) 1411 1412 ((b^2*x^2) + (4*b^2*x) + b^2 + (2*b^3*x) + (2*b^3) + b^4 + (2*b*x^2) + (2*b*x) + x^2) 1413#1: a = ------------------------------------------------------------------------------------- 1414 ((b^3*x^2) + (2*b^4*x) + b^5) 1415 14161-> y = (((b+1)^0.5)*((b^2.5)+c))+((((b^2)+b)^0.5)*a) 1417 1418 1 5 1 1419#2: y = (((b + 1)^-)*((b^-) + c)) + (((b^2 + b)^-)*a) 1420 2 2 2 1421 14222-> a = (b^(1-n))/(1+(b^(m-n))) 1423 1424 (b^(1 - n)) 1425#3: a = ----------------- 1426 (1 + (b^(m - n))) 1427 14283-> a = (((b^2)+(b*(c^(1-n)))+(b^0.5))/(b^n)/(1+(b^(m-n))))^0.5 1429 1430 1 1431 (b^2 + (b*(c^(1 - n))) + (b^-)) 1432 2 1 1433#4: a = -------------------------------^- 1434 (b^n*(1 + (b^(m - n)))) 2 1435 14364-> simplify all 1437 1438 1 1439 ((- + 1)^2) 1440 b 1441#1: a = ----------- 1442 b 1443 1444 1445 1 5 1 1446#2: y = ((b + 1)^-)*((b^-) + ((b^-)*a) + c) 1447 2 2 2 1448 1449 1450 b 1451#3: a = ----------- 1452 (b^n + b^m) 1453 1454 1455 1 1456 (b^2 + (b*(c^(1 - n))) + (b^-)) 1457 2 1 1458#4: a = -------------------------------^- 1459 (b^n + b^m) 2 1460 1461Successfully finished reading script file "fix8.in". 14624-> read fix9 14634-> clear all 14641-> ((1/b) + (1/c) + (1/d))^3 1465 1466 1 1 1 1467#1: (- + - + -)^3 1468 b c d 1469 14701-> ((+/-1000*(b!^4)+/-x)^2)*((1/x)+x)*b 1471 1472 1 1473#2: (((1000*sign*((b!)^4)) + (sign0*x))^2)*(- + x)*b 1474 x 1475 14762-> ((b+(2*i))^5) 1477 1478#3: (b + (2*i))^5 1479 14803-> (((1/(b^2))+c)^2)*((1/b)+(c*b)) 1481 1482 1 1 1483#4: ((--- + c)^2)*(- + (c*b)) 1484 b^2 b 1485 14864-> (6*(b^0.5)-3)^3 1487 1488 1 1489#5: ((6*(b^-)) - 3)^3 1490 2 1491 14925-> (2-(4/(c-b)))^3 1493 1494 4 1495#6: (2 - -------)^3 1496 (c - b) 1497 14986-> (((e*((2*(x^3)) + 24 + (x!) - zy)) - pi)/e)^2 1499 1500 ((e*((2*x^3) + 24 + x! - zy)) - pi) 1501#7: -----------------------------------^2 1502 e 1503 15047-> (2+3x)^3 1505 1506#8: (2 + (3*x))^3 1507 15088-> simplify all 1509 1510 1 1 1 1511#1: (- + - + -)^3 1512 b d c 1513 1514 1515 1 1516#2: ((x + (1000*sign*sign0*((b!)^4)))^2)*b*(- + x) 1517 x 1518 1519 1520#3: (b + (2*i))^5 1521 1522 1523 1 1 1524#4: ((--- + c)^2)*(- + (c*b)) 1525 b^2 b 1526 1527 1528 1 1529#5: -27*((1 - (2*(b^-)))^3) 1530 2 1531 1532 1533 2 1534#6: 8*((1 - -------)^3) 1535 (c - b) 1536 1537 1538 pi 1539#7: (zy - 24 + -- - x! - (2*x^3))^2 1540 e 1541 1542 1543#8: (2 + (3*x))^3 1544 15458-> display factor all 1546 1547 1 1 1 1548#1: (- + - + -)^3 1549 b d c 1550 1551 1552 1 1553#2: ((x + ((2^3*5^3)*sign*sign0*((b!)^(2^2))))^2)*b*(- + x) 1554 x 1555 1556 1557#3: (b + (2*i))^5 1558 1559 1560 1 1 1561#4: ((--- + c)^2)*(- + (c*b)) 1562 b^2 b 1563 1564 1565 1 1566#5: (3^3*-1)*((1 - (2*(b^-)))^3) 1567 2 1568 1569 1570 2 1571#6: 2^3*((1 - -------)^3) 1572 (c - b) 1573 1574 1575 pi 1576#7: (zy - (2^3*3) + -- - x! - (2*x^3))^2 1577 e 1578 1579 1580#8: (2 + (3*x))^3 1581 1582Successfully finished reading script file "fix9.in". 1583Successfully finished reading script file "test.in". 15848-> clear all 15851-> read fraction 15861-> 15871-> ; Algebraic fractions tutorial. 15881-> ; This Mathomatic input shows how "simplify fraction" and "unfactor fraction" work. 15891-> 1/x+1/y+1/z 1590 1591 1 1 1 1592#1: - + - + - 1593 x y z 1594 15951-> fraction ; Convert expressions with algebraic fractions into a single fraction. 1596 1597 ((y*z) + (x*(z + y))) 1598#1: --------------------- 1599 (x*y*z) 1600 16011-> simplify 1602 1603 1 1 1 1604#1: - + - + - 1605 x y z 1606 16071-> simplify fraction ; does the same as the above fraction command, but simplifies more. 1608 1609 ((z*y) + (x*(z + y))) 1610#1: --------------------- 1611 (x*y*z) 1612 16131-> unfactor ; Expand the products of sums. 1614 1615 ((z*y) + (x*z) + (x*y)) 1616#1: ----------------------- 1617 (x*y*z) 1618 16191-> unfactor fraction ; Fully expand algebraic fractions by also expanding division of sums. 1620 1621 1 1 1 1622#1: - + - + - 1623 x y z 1624 1625Successfully finished reading script file "fraction.in". 16261-> clear all 16271-> read pie 16281-> 16291-> ; This is the famous Bailey-Borwein-Plouffe (BBP) formula. 16301-> ; Sum this n = 0 to infinity to compute pi. 16311-> ; This is especially useful for calculating pi in hexadecimal. 16321-> ; One hexadecimal digit of pi is generated with each iteration. 16331-> ((4/((8*n)+1))-(2/((8*n)+4))-(1/((8*n)+5))-(1/((8*n)+6)))/(16^n) 1634 1635 4 2 1 1 1636 (----------- - ----------- - ----------- - -----------) 1637 ((8*n) + 1) ((8*n) + 4) ((8*n) + 5) ((8*n) + 6) 1638#1: ------------------------------------------------------- 1639 16^n 1640 16411-> simplify ; BBP simplifies to the ratio of two polynomials. 1642 1643 ((120*n^2) + (151*n) + 47) 1644#1: ---------------------------------------------------------- 1645 (16^n*((512*n^4) + (1024*n^3) + (712*n^2) + (194*n) + 15)) 1646 16471-> sum n=0 to 10 ; Numerically sum BBP from n = 0 to 10 in steps of 1. 1648 1649#2: 3.1415926535898 1650 16511-> pi ; The digits should be the same. 1652Calculating... 1653 answer = 3.1415926535898 16543-> repeat echo * 1655******************************************************************************* 16563-> x^n/n! ; Sum this n = 0 to infinity to compute (e^x). 1657 1658 x^n 1659#4: --- 1660 n! 1661 16624-> replace x with 1 ; Sum this n = 0 to infinity to compute e: 1663 1664 1 1665#4: -- 1666 n! 1667 16684-> sum n=0 to 20 ; Numerically sum from n = 0 to 20 in steps of 1. 1669 1670#5: 2.718281828459 1671 16724-> e ; The digits should be the same. 1673Calculating... 1674 answer = 2.718281828459 16756-> repeat echo * 1676******************************************************************************* 16776-> ; Euler's identity is made of these most important universal constants: 16786-> e^(pi*i)+1=0 1679 1680#7: (e^(pi*i)) + 1 = 0 1681 16827-> simplify ; An identity is when the LHS is identical to the RHS: 1683 1684#7: 0 = 0 1685 1686Successfully finished reading script file "pie.in". 16877-> 1 1688 1689 ((120*n^2) + (151*n) + 47) 1690#1: ---------------------------------------------------------- 1691 (16^n*((512*n^4) + (1024*n^3) + (712*n^2) + (194*n) + 15)) 1692 16931-> fraction 1694 1695 ((120*n^2) + (151*n) + 47) 1696#1: ---------------------------------------------------------- 1697 (16^n*((512*n^4) + (1024*n^3) + (712*n^2) + (194*n) + 15)) 1698 16991-> read demo 17001-> clear all 17011-> ; Some symbolic differentiation examples follow. 17021-> 17031-> ; Take the derivative of the absolute value function: 17041-> |x| 1705 1706 1 1707#1: (x^2)^- 1708 2 1709 17101-> derivative ; The result is the sign function sgn(x), which gives the sign of x. 1711Differentiating with respect to x and simplifying... 1712 1713 x 1714#2: --------- 1715 1 1716 ((x^2)^-) 1717 2 1718 17192-> repeat echo * 1720******************************************************************************* 17212-> ; Mathomatic can differentiate anything that doesn't require symbolic logarithms. 17222-> y=e^(1+1/x) 1723 1724 1 1725#3: y = e^(1 + -) 1726 x 1727 17283-> derivative ; The first order derivative is: 1729Differentiating the RHS with respect to x and simplifying... 1730 1731 1 1732 -(e^(1 + -)) 1733 x 1734#4: y' = ------------ 1735 x^2 1736 17374-> derivative ; The second order derivative is: 1738Differentiating the RHS with respect to x and simplifying... 1739 1740 1 1 1741 (e^(- + 1))*(- + 2) 1742 x x 1743#5: y'' = ------------------- 1744 x^3 1745 17465-> expand fraction ; Perhaps easier to read: 1747 1748 1 1 1749 (e^(- + 1)) 2*(e^(- + 1)) 1750 x x 1751#5: y'' = ----------- + ------------- 1752 x^4 x^3 1753 17545-> repeat echo * 1755******************************************************************************* 17565-> ; A Taylor series demonstration: 17575-> y=x_new^n ; x_new is what we want, without using the root operator. 1758 1759#6: y = x_new^n 1760 17616-> x_new ; It is easily solved for in Mathomatic. 1762Solve successful: 1763 1764 1 1765#6: x_new = y^- 1766 n 1767 17686-> y ; But we want an algorithm to compute it without using non-integer exponentiation. 1769Solve successful: 1770 1771#6: y = x_new^n 1772 17736-> taylor x_new, 1, x_old ; build the (nth root of y) iterative approximation formula 1774Taylor series of the RHS with respect to x_new, simplified... 17751 non-zero derivative applied. 1776 1777#7: y = x_old^n + (n*(x_old^(n - 1))*x_new) - (n*x_old^n) 1778 17797-> solve verifiable x_new ; solve for the output variable 1780Solving equation #7 for x_new with required verification... 1781Solve and "repeat simplify quick" successful: 1782 1783 y 1784 (------- - 1) 1785 x_old^n 1786#7: x_new = x_old*(------------- + 1) 1787 n 1788 1789Solution verified. 17907-> ; That is the convergent nth root approximation formula. 17917-> copy ; "calculate x_old 10000" tests this formula, if you would like to see for yourself. 1792 1793 y 1794 (------- - 1) 1795 x_old^n 1796#8: x_new = x_old*(------------- + 1) 1797 n 1798 17997-> replace x_old x_new with x ; make x_old (input) and x_new (output) the same 1800 1801 y 1802 (--- - 1) 1803 x^n 1804#7: x = x*(--------- + 1) 1805 n 1806 18077-> x ; make sure the formula was correct by solving for x 1808Removing possible solution: "x = 0". 1809Solve successful: 1810 1811 1 1812#7: x = y^- 1813 n 1814 18157-> repeat echo * 1816******************************************************************************* 18177-> ; Another Taylor series demo: 18187-> e^x ; enter the exponential function 1819 1820#9: e^x 1821 18229-> taylor x, 10, 0 ; generate a 10th order taylor series of the exponential function 1823Taylor series with respect to x, simplified... 182410 non-zero derivatives applied. 1825 1826 x^2 x^3 x^4 x^5 x^6 x^7 x^8 x^9 x^10 1827#10: 1 + x + --- + --- + --- + --- + --- + ---- + ----- + ------ + ------- 1828 2 6 24 120 720 5040 40320 362880 3628800 1829 183010-> laplace x ; do a Laplace transform on it 1831 1832 1 1 1 1 1 1 1 1 1 1 1 1833#11: - + --- + --- + --- + --- + --- + --- + --- + --- + ---- + ---- 1834 x x^2 x^3 x^4 x^5 x^6 x^7 x^8 x^9 x^10 x^11 1835 183611-> simplify ; show the structure of the result 1837 1838 1 1839 (1 + -) 1840 x 1841 (1 + -------) 1842 x 1843 (1 + -------------) 1844 x 1845 (1 + -------------------) 1846 x 1847 (1 + -------------------------) 1848 x 1849 (1 + -------------------------------) 1850 x 1851 (1 + -------------------------------------) 1852 x 1853 (1 + -------------------------------------------) 1854 x 1855 (1 + -------------------------------------------------) 1856 x 1857 (1 + -------------------------------------------------------) 1858 x 1859#11: ------------------------------------------------------------- 1860 x 1861 186211-> laplace inverse x ; undo the Laplace transform 1863 1864 x^2 x^3 x^4 x^5 x^6 x^7 x^8 x^9 x^10 1865#12: 1 + x + --- + --- + --- + --- + --- + ---- + ----- + ------ + ------- 1866 2 6 24 120 720 5040 40320 362880 3628800 1867 186812-> compare with 10 ; check the result 1869Comparing #10 with #12... 1870Expressions are identical. 1871Successfully finished reading script file "demo.in". 187212-> read limits 187312-> 187412-> ; Tests for the experimental limit command. 187512-> 187612-> clear all 18771-> ; find the derivative of: 18781-> y = 1/(x^.5) 1879 1880 1 1881#1: y = ----- 1882 1 1883 (x^-) 1884 2 1885 18861-> ; using the difference quotient: 18871-> y' = (1/(x+delta_x)^.5-1/x^.5)/delta_x 1888 1889 1 1 1890 (----------------- - -----) 1891 1 1 1892 ((x + delta_x)^-) (x^-) 1893 2 2 1894#2: y' = --------------------------- 1895 delta_x 1896 18972-> limit delta_x 0 ; take the limit as delta_x (change in x) goes to 0 1898Taking the limit as delta_x goes to 0 1899Solving... 1900Equation is a degree 0.5 polynomial equation in delta_x. 1901Raising both equation sides to the power of 2 and expanding... 1902Equation is a degree 3 polynomial equation in delta_x. 1903Removing possible solution: "delta_x = 0". 1904Equation is a degree 2 polynomial equation in delta_x. 1905Equation was solved with the quadratic formula. 1906Equation is a degree 0.5 polynomial equation in y'. 1907Raising both equation sides to the power of 2 and expanding... 1908 1909 -1 1910#3: y' = --------- 1911 3 1912 (2*(x^-)) 1913 2 1914 19152-> 3 1916 1917 -1 1918#3: y' = --------- 1919 3 1920 (2*(x^-)) 1921 2 1922 19233-> integrate x ; take the antiderivative to see if it's right 1924Only the RHS will be transformed. 1925Integrating the RHS with respect to x and simplifying... 1926 1927 1 1928#4: y = ----- 1929 1 1930 (x^-) 1931 2 1932 19334-> compare 1 1934Comparing #1 with #4... 1935Equations are identical. 19364-> 19374-> ; test infinity limits: 19384-> 2x/(x+1) 1939 1940 2*x 1941#5: ------- 1942 (x + 1) 1943 19445-> limit x inf ; answer should be 2 1945Taking the limit as x goes to inf 1946Solving... 1947 1948#6: limit = 2 1949 19505-> 19515-> (3x+100-a)/(x-b) 1952 1953 ((3*x) + 100 - a) 1954#7: ----------------- 1955 (x - b) 1956 19577-> limit x inf ; answer should be 3 1958Taking the limit as x goes to inf 1959Solving... 1960 1961#8: limit = 3 1962 19637-> 19647-> (((x^2) - (5*x) + 6)^(1/2)) - x 1965 1966 1 1967#9: ((x^2 - (5*x) + 6)^-) - x 1968 2 1969 19709-> limit x inf ; answer should be -5/2 1971Taking the limit as x goes to inf 1972Solving... 1973Equation is a degree 0.5 polynomial equation in x. 1974Raising both equation sides to the power of 2 and expanding... 1975Equation is a degree 2 polynomial equation in x. 1976Equation was solved with the quadratic formula. 1977 1978 -5 1979#10: limit = -- 1980 2 1981 19829-> 19839-> x*((x^2+1)^.5-x) 1984 1985 1 1986#11: x*(((x^2 + 1)^-) - x) 1987 2 1988 198911-> limit x inf ; answer should be 1/2 1990Taking the limit as x goes to inf 1991Solving... 1992Equation is a degree 1.5 polynomial equation in x. 1993Raising both equation sides to the power of 2 and expanding... 1994Equation is a degree 3 polynomial equation in x. 1995Removing possible solution: "x = 0". 1996 1997 1 1998#12: limit = - 1999 2 2000 200111-> 200211-> 1/x^2+1/x 2003 2004 1 1 2005#13: --- + - 2006 x^2 x 2007 200813-> limit y inf ; result should be original expression with a warning. 2009Warning: Limit variable not found; answer is original expression. 2010 2011 1 1 2012#13: limit = --- + - 2013 x^2 x 2014 201513-> limit x inf ; result should be 0 2016Taking the limit as x goes to inf 2017Solving... 2018Equation is a degree 2 polynomial equation in x. 2019Equation was solved with the quadratic formula. 2020 2021#14: limit = 0 2022 202313-> 202413-> ((2*(x^2)) - x - 6)/((x^2) + (2*x) - 8) 2025 2026 ((2*x^2) - x - 6) 2027#15: ----------------- 2028 (x^2 + (2*x) - 8) 2029 203015-> limit x inf ; result should be 2 2031Taking the limit as x goes to inf 2032Solving... 2033 2034#16: limit = 2 2035 203615-> 203715-> x^2+x 2038 2039#17: x^2 + x 2040 204117-> limit x 0 ; result should be 0 2042Taking the limit as x goes to 0 2043Solving... 2044Equation is a degree 2 polynomial equation in x. 2045Equation was solved with the quadratic formula. 2046 2047#18: limit = 0 2048 204917-> limit x 2 ; result should be 6 2050Taking the limit as x goes to 2 2051Solving... 2052Equation is a degree 2 polynomial equation in x. 2053Equation was solved with the quadratic formula. 2054 2055#19: limit = 6 2056 205717-> display 2058 2059#17: limit = x^2 + x 2060 206117-> ; The following currently gives the wrong answer: 206217-> limit x inf ; result should be inf 2063Taking the limit as x goes to inf 2064Solving... 2065Equation is a degree 2 polynomial equation in x. 2066Equation was solved with the quadratic formula. 2067 2068#20: limit = 0 2069 207017-> ; The following currently gives errors: 207117-> y=x+1/x 2072 2073 1 2074#21: y = x + - 2075 x 2076 207721-> :limit x 0 ; result should be inf 2078Taking the limit as x goes to 0 2079Solving... 2080Equation is a degree 2 polynomial equation in x. 2081Equation was solved with the quadratic formula. 2082Equation is a degree 0.5 polynomial equation in y. 2083Raising both equation sides to the power of 2 and expanding... 2084There are no possible values for the solve variable. 2085Can't take the limit because solve failed. 208621-> :limit x inf; result should be inf 2087Taking the limit as x goes to inf 2088Solving... 2089Equation is a degree 2 polynomial equation in x. 2090Equation was solved with the quadratic formula. 2091Equation is a degree 0.5 polynomial equation in y. 2092Raising both equation sides to the power of 2 and expanding... 2093There are no possible values for the solve variable. 2094Can't take the limit because solve failed. 2095Successfully finished reading script file "limits.in". 209621-> ; read how_limit_works 209721-> read test3 209821-> ; Test solving linear equations with Mathomatic. 209921-> 210021-> read linear 210121-> 210221-> ; Combine 3 simultaneous linear equations with 3 unknowns (x, y, z). 210321-> ; Solve for all 3 unknowns using the eliminate, solve, and simplify commands. 210421-> 210521-> clear all ; restart Mathomatic 21061-> ; enter all 3 equations: 21071-> d1=a1*x+b1*y+c1*z 2108 2109#1: d1 = (a1*x) + (b1*y) + (c1*z) 2110 21111-> d2=a2*x+b2*y+c2*z 2112 2113#2: d2 = (a2*x) + (b2*y) + (c2*z) 2114 21152-> d3=a3*x+b3*y+c3*z 2116 2117#3: d3 = (a3*x) + (b3*y) + (c3*z) 2118 21193-> 2 ; select equation number 2 as the current equation 2120 2121#2: d2 = (a2*x) + (b2*y) + (c2*z) 2122 21232-> eliminate x ; eliminate variable x from the current equation 2124Solving equation #1 for x and substituting into the current equation... 2125 2126 a2*((b1*y) + (c1*z) - d1) 2127#2: d2 = (b2*y) - ------------------------- + (c2*z) 2128 a1 2129 21302-> 3 ; select equation number 3 2131 2132#3: d3 = (a3*x) + (b3*y) + (c3*z) 2133 21343-> eliminate x y ; eliminate variables x and then y from the current equation 2135Eliminating variable x using solved equation #1... 2136Solving equation #2 for y and substituting into the current equation... 2137 2138 b1*((z*((c2*a1) - (a2*c1))) + (a2*d1) - (d2*a1)) 2139 a3*(------------------------------------------------ + (c1*z) - d1) 2140 b3*((z*((c2*a1) - (a2*c1))) + (a2*d1) - (d2*a1)) ((a2*b1) - (b2*a1)) 2141#3: d3 = ------------------------------------------------ - ------------------------------------------------------------------- + (c3*z) 2142 ((a2*b1) - (b2*a1)) a1 2143 21443-> solve for z 2145Solve successful: 2146 2147 ((d3*((a2*b1) - (a1*b2))) + (b3*((d2*a1) - (a2*d1))) + (a3*((b2*d1) - (b1*d2)))) 2148#3: z = -------------------------------------------------------------------------------- 2149 ((b3*((c2*a1) - (a2*c1))) + (a3*((b2*c1) - (b1*c2))) + (c3*((a2*b1) - (a1*b2)))) 2150 21513-> 2 ; select equation number 2 2152 2153 ((z*((c2*a1) - (a2*c1))) + (a2*d1) - (d2*a1)) 2154#2: y = --------------------------------------------- 2155 ((a2*b1) - (b2*a1)) 2156 21572-> eliminate z using 3 ; find y by combining equation numbers 2 and 3 2158Eliminating variable z using solved equation #3... 2159 2160 ((d3*((a2*b1) - (a1*b2))) + (b3*((d2*a1) - (a2*d1))) + (a3*((b2*d1) - (b1*d2))))*((c2*a1) - (a2*c1)) 2161 (---------------------------------------------------------------------------------------------------- + (a2*d1) - (d2*a1)) 2162 ((b3*((c2*a1) - (a2*c1))) + (a3*((b2*c1) - (b1*c2))) + (c3*((a2*b1) - (a1*b2)))) 2163#2: y = -------------------------------------------------------------------------------------------------------------------------- 2164 ((a2*b1) - (b2*a1)) 2165 21662-> simplify 2167 2168 ((a1*((d3*c2) - (d2*c3))) + (d1*((a2*c3) - (c2*a3))) + (c1*((d2*a3) - (d3*a2)))) 2169#2: y = -------------------------------------------------------------------------------- 2170 ((a1*((b3*c2) - (c3*b2))) + (c1*((a3*b2) - (b3*a2))) + (b1*((c3*a2) - (a3*c2)))) 2171 21722-> 1 ; select equation number 1 2173 2174 -((b1*y) + (c1*z) - d1) 2175#1: x = ----------------------- 2176 a1 2177 21781-> eliminate z using 3, y using 2; find x 2179Eliminating variable z using solved equation #3... 2180Eliminating variable y using solved equation #2... 2181 2182 b1*((a1*((d3*c2) - (d2*c3))) + (d1*((a2*c3) - (c2*a3))) + (c1*((d2*a3) - (d3*a2)))) c1*((d3*((a2*b1) - (a1*b2))) + (b3*((d2*a1) - (a2*d1))) + (a3*((b2*d1) - (b1*d2)))) 2183 -(----------------------------------------------------------------------------------- + ----------------------------------------------------------------------------------- - d1) 2184 ((a1*((b3*c2) - (c3*b2))) + (c1*((a3*b2) - (b3*a2))) + (b1*((c3*a2) - (a3*c2)))) ((b3*((c2*a1) - (a2*c1))) + (a3*((b2*c1) - (b1*c2))) + (c3*((a2*b1) - (a1*b2)))) 2185#1: x = --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2186 a1 2187 21881-> 21891-> simplify all ; simplify and display all solutions 2190 2191 ((c1*((b2*d3) - (b3*d2))) + (b1*((c3*d2) - (c2*d3))) + (d1*((b3*c2) - (c3*b2)))) 2192#1: x = -------------------------------------------------------------------------------- 2193 ((a1*((b3*c2) - (c3*b2))) + (c1*((a3*b2) - (b3*a2))) + (b1*((c3*a2) - (a3*c2)))) 2194 2195 2196 ((a1*((d3*c2) - (d2*c3))) + (d1*((a2*c3) - (c2*a3))) + (c1*((d2*a3) - (d3*a2)))) 2197#2: y = -------------------------------------------------------------------------------- 2198 ((a1*((b3*c2) - (c3*b2))) + (c1*((a3*b2) - (b3*a2))) + (b1*((c3*a2) - (a3*c2)))) 2199 2200 2201 ((b1*((d3*a2) - (a3*d2))) + (a1*((b3*d2) - (d3*b2))) + (d1*((a3*b2) - (b3*a2)))) 2202#3: z = -------------------------------------------------------------------------------- 2203 ((a1*((b3*c2) - (c3*b2))) + (c1*((a3*b2) - (b3*a2))) + (b1*((c3*a2) - (a3*c2)))) 2204 2205Successfully finished reading script file "linear.in". 22061-> copy 2207 2208 ((c1*((b2*d3) - (b3*d2))) + (b1*((c3*d2) - (c2*d3))) + (d1*((b3*c2) - (c3*b2)))) 2209#4: x = -------------------------------------------------------------------------------- 2210 ((a1*((b3*c2) - (c3*b2))) + (c1*((a3*b2) - (b3*a2))) + (b1*((c3*a2) - (a3*c2)))) 2211 22121-> b2 2213Solve successful: 2214 2215 ((x*((b3*((a1*c2) - (c1*a2))) + (b1*((c3*a2) - (a3*c2))))) - (d2*((b1*c3) - (c1*b3))) - (c2*((d1*b3) - (b1*d3)))) 2216#1: b2 = ----------------------------------------------------------------------------------------------------------------- 2217 ((c1*(d3 - (x*a3))) + (c3*((x*a1) - d1))) 2218 22191-> c2 2220Solve successful: 2221 2222 ((b2*((c1*(d3 - (x*a3))) + (c3*((x*a1) - d1)))) + (((b1*c3) - (c1*b3))*(d2 - (x*a2)))) 2223#1: c2 = -------------------------------------------------------------------------------------- 2224 ((x*((b3*a1) - (b1*a3))) - (d1*b3) + (b1*d3)) 2225 22261-> b3 2227Solve successful: 2228 2229 ((b1*((c2*(d3 - (x*a3))) + (c3*((x*a2) - d2)))) - (b2*((c1*(d3 - (x*a3))) + (c3*((x*a1) - d1))))) 2230#1: b3 = ------------------------------------------------------------------------------------------------- 2231 ((c1*((x*a2) - d2)) + (c2*(d1 - (x*a1)))) 2232 22331-> c3 2234Solve successful: 2235 2236 ((b3*((c1*((x*a2) - d2)) + (c2*(d1 - (x*a1))))) + (((x*a3) - d3)*((b1*c2) - (b2*c1)))) 2237#1: c3 = -------------------------------------------------------------------------------------- 2238 ((b1*((x*a2) - d2)) + (b2*(d1 - (x*a1)))) 2239 22401-> b1 2241Solve successful: 2242 2243 ((b2*((c3*(d1 - (x*a1))) + (c1*((x*a3) - d3)))) - (b3*((c1*((x*a2) - d2)) + (c2*(d1 - (x*a1)))))) 2244#1: b1 = ------------------------------------------------------------------------------------------------- 2245 ((c2*((x*a3) - d3)) + (c3*(d2 - (x*a2)))) 2246 22471-> c1 2248Solve successful: 2249 2250 ((b1*((c2*((x*a3) - d3)) + (c3*(d2 - (x*a2))))) + (((x*a1) - d1)*((b2*c3) - (b3*c2)))) 2251#1: c1 = -------------------------------------------------------------------------------------- 2252 ((b2*((x*a3) - d3)) + (b3*(d2 - (x*a2)))) 2253 22541-> d2 2255Solve successful: 2256 2257 ((c1*((b2*((x*a3) - d3)) - (b3*x*a2))) - (((b2*c3) - (b3*c2))*((x*a1) - d1)) + (b1*((c2*(d3 - (x*a3))) + (c3*x*a2)))) 2258#1: d2 = --------------------------------------------------------------------------------------------------------------------- 2259 ((b1*c3) - (c1*b3)) 2260 22611-> a2 2262Solve successful: 2263 2264 ((d2*((b1*c3) - (c1*b3))) + (((b2*c3) - (b3*c2))*((x*a1) - d1)) + ((d3 - (x*a3))*((c1*b2) - (b1*c2)))) 2265#1: a2 = ------------------------------------------------------------------------------------------------------ 2266 (x*((b1*c3) - (c1*b3))) 2267 22681-> d3 2269Solve successful: 2270 2271 ((((b1*c3) - (c1*b3))*((a2*x) - d2)) - (((b2*c3) - (b3*c2))*((x*a1) - d1))) 2272#1: d3 = --------------------------------------------------------------------------- + (x*a3) 2273 ((c1*b2) - (b1*c2)) 2274 22751-> a3 2276Solve successful: 2277 2278 -((((b1*c3) - (c1*b3))*((a2*x) - d2)) - (((b2*c3) - (b3*c2))*((x*a1) - d1)) - (d3*((c1*b2) - (b1*c2)))) 2279#1: a3 = ------------------------------------------------------------------------------------------------------- 2280 (((c1*b2) - (b1*c2))*x) 2281 22821-> d1 2283Solve successful: 2284 2285 ((((c1*b2) - (b1*c2))*((a3*x) - d3)) + (((b1*c3) - (c1*b3))*((a2*x) - d2))) 2286#1: d1 = -(--------------------------------------------------------------------------- - (x*a1)) 2287 ((b2*c3) - (b3*c2)) 2288 22891-> a1 2290Solve successful: 2291 2292 ((d1*((b2*c3) - (b3*c2))) + (((c1*b2) - (b1*c2))*((a3*x) - d3)) + (((b1*c3) - (c1*b3))*((a2*x) - d2))) 2293#1: a1 = ------------------------------------------------------------------------------------------------------ 2294 (((b2*c3) - (b3*c2))*x) 2295 22961-> x 2297Solve successful: 2298 2299 ((d1*((b2*c3) - (b3*c2))) + (d3*((b1*c2) - (c1*b2))) + (d2*((c1*b3) - (b1*c3)))) 2300#1: x = -------------------------------------------------------------------------------- 2301 ((a1*((b2*c3) - (b3*c2))) + (a3*((b1*c2) - (c1*b2))) + (a2*((c1*b3) - (b1*c3)))) 2302 23031-> compare with 4 2304Comparing #4 with #1... 2305Simplifying both equations... 2306Equations are identical. 2307Successfully finished reading script file "test3.in". 23081-> read poly 23091-> 23101-> ; Combine 3 quadratic polynomial equations with 3 unknown coefficients (a, b, c). 23111-> ; Solve for variables (a), (b), and (c). 23121-> 23131-> clear all ; restart Mathomatic 23141-> ; enter all 3 equations: 23151-> y1=a+b*x1+c*x1^2 2316 2317#1: y1 = a + (b*x1) + (c*x1^2) 2318 23191-> y2=a+b*x2+c*x2^2 2320 2321#2: y2 = a + (b*x2) + (c*x2^2) 2322 23232-> y3=a+b*x3+c*x3^2 2324 2325#3: y3 = a + (b*x3) + (c*x3^2) 2326 23273-> 2 ; select equation number 2 as the current equation 2328 2329#2: y2 = a + (b*x2) + (c*x2^2) 2330 23312-> eliminate a ; eliminate variable (a) from the current equation 2332Solving equation #1 for a and substituting into the current equation... 2333 2334#2: y2 = (b*x2) - (x1*(b + (c*x1))) + y1 + (c*x2^2) 2335 23362-> 3 ; select equation number 3 2337 2338#3: y3 = a + (b*x3) + (c*x3^2) 2339 23403-> eliminate a b ; eliminate variables (a) and then (b) from the current equation 2341Eliminating variable a using solved equation #1... 2342Solving equation #2 for b and substituting into the current equation... 2343 2344 (y1 - y2 + (c*(x2^2 - x1^2)))*x3 (y1 - y2 + (c*(x2^2 - x1^2))) 2345#3: y3 = -------------------------------- - (x1*(----------------------------- + (c*x1))) + y1 + (c*x3^2) 2346 (x1 - x2) (x1 - x2) 2347 23483-> solve verifiable c 2349Solving equation #3 for c with required verification... 2350Solve and "repeat simplify quick" successful: 2351 2352 ((x1*(y2 - y3)) + (x3*(y1 - y2)) + (x2*(y3 - y1))) 2353#3: c = -------------------------------------------------- 2354 ((x2 - x1)*(x3 - x1)*(x3 - x2)) 2355 2356Solution verified. 23573-> simplify 2358 2359 (y1 - y2) (y3 - y2) 2360 (--------- + ---------) 2361 (x2 - x1) (x3 - x2) 2362#3: c = ----------------------- 2363 (x3 - x1) 2364 23653-> 2 ; select equation number 2 again 2366 2367 (y1 - y2 + (c*(x2^2 - x1^2))) 2368#2: b = ----------------------------- 2369 (x1 - x2) 2370 23712-> eliminate c using 3 ; find (b) by combining equation numbers 2 and 3 2372Eliminating variable c using solved equation #3... 2373 2374 (y1 - y2) (y3 - y2) 2375 (--------- + ---------)*(x2^2 - x1^2) 2376 (x2 - x1) (x3 - x2) 2377 (y1 - y2 + -------------------------------------) 2378 (x3 - x1) 2379#2: b = ------------------------------------------------- 2380 (x1 - x2) 2381 23822-> simplify 2383 2384 ((x1^2*(y2 - y3)) + (x3^2*(y1 - y2)) + (x2^2*(y3 - y1))) 2385#2: b = -------------------------------------------------------- 2386 ((x2 - x1)*(x3 - x1)*(x2 - x3)) 2387 23882-> 1 ; select equation number 1 2389 2390#1: a = -((x1*(b + (c*x1))) - y1) 2391 23921-> eliminate c using 3, b using 2 ; find (a) 2393Eliminating variable c using solved equation #3... 2394Eliminating variable b using solved equation #2... 2395 2396 (y1 - y2) (y3 - y2) 2397 (--------- + ---------)*x1 2398 ((x1^2*(y2 - y3)) + (x3^2*(y1 - y2)) + (x2^2*(y3 - y1))) (x2 - x1) (x3 - x2) 2399#1: a = -((x1*(-------------------------------------------------------- + --------------------------)) - y1) 2400 ((x2 - x1)*(x3 - x1)*(x2 - x3)) (x3 - x1) 2401 24021-> 24031-> simplify fraction all ; display all solutions, converting to simple fractions first 2404 2405 ((x1^2*((y2*x3) - (y3*x2))) + (x1*((x2^2*y3) - (x3^2*y2))) + (y1*((x3^2*x2) - (x3*x2^2)))) 2406#1: a = ------------------------------------------------------------------------------------------ 2407 ((x2 - x1)*(x3 - x1)*(x3 - x2)) 2408 2409 2410 ((x1^2*(y2 - y3)) + (x3^2*(y1 - y2)) + (x2^2*(y3 - y1))) 2411#2: b = -------------------------------------------------------- 2412 ((x2 - x1)*(x3 - x1)*(x2 - x3)) 2413 2414 2415 ((x3*(y1 - y2)) + (x2*(y3 - y1)) + (x1*(y2 - y3))) 2416#3: c = -------------------------------------------------- 2417 ((x2 - x1)*(x3 - x1)*(x3 - x2)) 2418 2419Successfully finished reading script file "poly.in". 24201-> clear all 24211-> read examples 24221-> 24231-> ; This is a line comment. This script shows some simple examples of Mathomatic usage. 24241-> ; Mathomatic input files are scripts that may be read in with the "read" command. 24251-> 24261-> ; Equations are entered by just typing or pasting them in: 24271-> c^2=a^2+b^2 ; The Pythagorean theorem, "c" squared equals "a" squared plus "b" squared. 2428 2429#1: c^2 = a^2 + b^2 2430 24311-> ; The entered equation becomes the current equation and is displayed. 24321-> ; The current equation can be solved by simply typing in a variable name: 24331-> c ; which is shorthand for the solve command. Solve for variable "c". 2434Solve successful: 2435 2436 1 2437#1: c = ((a^2 + b^2)^-)*sign 2438 2 2439 24401-> ; "sign" variables are special two-valued variables that may only be +1 or -1. 24411-> solve for b ; Another way to solve for a variable, using English. 2442Solve successful: 2443 2444 1 2445#1: b = ((c^2 - a^2)^-)*sign0 2446 2 2447 24481-> ; To output programming language code, use the code command: 24491-> code ; C language code is the default. 2450b = (pow(((c*c) - (a*a)), (1.0/2.0))*sign0); 24511-> 24521-> code java ; Mathomatic can also generate Java 2453b = (Math.pow(((c*c) - (a*a)), (1.0/2.0))*sign0); 24541-> 24551-> code python ; and Python code. 2456b = ((((c*c) - (a*a))**(1.0/2.0))*sign0) 24571-> 24581-> repeat echo * 2459******************************************************************************* 24601-> a=b+1/b ; Enter another equation; this is actually a quadratic equation. 2461 2462 1 2463#2: a = b + - 2464 b 2465 24662-> 0 ; Solve for zero. 2467Solve successful: 2468 2469#2: 0 = (b*(b - a)) + 1 2470 24712-> unfactor ; Expand, showing that this is a quadratic polynomial equation in "b". 2472 2473#2: 0 = b^2 - (b*a) + 1 2474 24752-> solve verifiable b ; Require solution verification with the "verifiable" option. 2476Solving equation #2 for b with required verification... 2477Equation is a degree 2 polynomial equation in b. 2478Equation was solved with the quadratic formula. 2479Solve and "repeat simplify quick" successful: 2480 2481 1 2482 ((((a^2 - 4)^-)*sign) + a) 2483 2 2484#2: b = -------------------------- 2485 2 2486 2487All solutions verified. 24882-> a ; Solve back for "a" and we should get the original equation. 2489Equation is a degree 0.5 polynomial equation in a. 2490Raising both equation sides to the power of 2 and expanding... 2491Solve successful: 2492 2493 (b^2 + 1) 2494#2: a = --------- 2495 b 2496 24972-> simplify ; The simplify command makes expressions simpler and prettier. 2498 2499 1 2500#2: a = b + - 2501 b 2502 25032-> repeat echo * 2504******************************************************************************* 25052-> ; Mathomatic is also handy as an advanced calculator. 25062-> ; Expressions without variables entered at the main prompt are instantly evaluated: 25072-> 2+3 2508Calculating... 2509 answer = 5 25103-> 495/44 ; Fractions are always reduced to their simplest form: 2511Calculating... 2512 answer = 11.25, with fractions it is: 45/4 25134-> ; Fractions greater than 1 can easily be displayed as mixed fractions. 25144-> display mixed ; Display above fraction as a mixed fraction: 2515 2516 1 2517#4: answer = 11 + - 2518 4 2519 25204-> display factor ; Integers and fractions are easily factored: 2521 2522 (3^2*5) 2523#4: answer = ------- 2524 2^2 2525 25264-> 2^.5 ; The square root of 2, rounded to the default 14 digits: 2527Calculating... 2528 answer = 1.4142135623731 25295-> 25305-> repeat echo * 2531******************************************************************************* 25325-> ; Symbolic logarithms like log(x) are not implemented, yet. 25335-> 27^y=9 ; An example that uses numeric logarithms. 2534 2535#6: 27^y = 9 2536 25376-> solve verifiable y ; Require solution verification with the "verifiable" option. 2538Solving equation #6 for y with required verification... 2539Solve and "repeat simplify quick" successful: 2540 2541 2 2542#6: y = - 2543 3 2544 2545Solution verified. 25466-> 25476-> repeat echo * 2548******************************************************************************* 25496-> 0=2x^2-3x-20 ; A simple quadratic equation, to show how the calculate command works. 2550 2551#7: 0 = (2*x^2) - (3*x) - 20 2552 25537-> solve verifiable x ; Solve for x, plugging the results into the original equation to verify. 2554Solving equation #7 for x with required verification... 2555Equation is a degree 2 polynomial equation in x. 2556Equation was solved with the quadratic formula. 2557Solve and "repeat simplify quick" successful: 2558 2559 3 13*sign 2560#7: x = - - ------- 2561 4 4 2562 2563All solutions verified. 25647-> calculate ; Expand "sign" variables and approximate the RHS (Right-Hand Side). 2565There are 2 solutions. 2566 2567Solution number 1 with sign = 1: 2568 x = -2.5, with fractions it is: -5/2 2569 2570Solution number 2 with sign = -1: 2571 x = 4 25727-> ; The calculate command also lets you plug values into a formula with variables, if any. 25737-> display; Display the current equation, showing that it was not modified by calculate. 2574 2575 3 13*sign 2576#7: x = - - ------- 2577 4 4 2578 2579Successfully finished reading script file "examples.in". 25807-> clear all 25811-> read test1 25821-> y = .6666 - (4*(((10*(pi^2)*(r^3)/((d^2)*g*m*epsilon)) - 1)^(1/2))/15) 2583 2584 10*pi^2*r^3 1 2585 4*((----------------- - 1)^-) 2586 (d^2*g*m*epsilon) 2 2587#1: y = 0.6666 - ----------------------------- 2588 15 2589 25901-> simplify 2591 2592 pi 2593 10*(--^2)*r^3 2594 d 1 2595 4*((------------- - 1)^-) 2596 (g*m*epsilon) 2 2597#1: y = 0.6666 - ------------------------- 2598 15 2599 26001-> simplify symbolic 2601 2602 10*pi^2*r^3 1 2603 4*((------------- - d^2)^-) 2604 (g*m*epsilon) 2 2605#1: y = 0.6666 - --------------------------- 2606 (15*d) 2607 26081-> r 2609Solve successful: 2610 2611 15*(0.6666 - y)*d 2612 g*m*epsilon*((-----------------^2) + d^2) 2613 4 1 2614#1: r = -----------------------------------------^- 2615 (10*pi^2) 3 2616 26171-> repeat simplify 2618 2619 d 2 45*y^2 1 2620#1: r = (--^-)*((g*m*epsilon*(0.72487500625 + ------ - (1.8748125*y)))^-) 2621 pi 3 32 3 2622 26231-> y 2624Equation is a degree 2 polynomial equation in y. 2625Equation was solved with the quadratic formula. 2626Solve successful: 2627 2628 1 2629 ((0.6666*d^2*g*m*epsilon) - (0.25773333555556*((((2.5863941835972*d^2*g*m*epsilon)^2) + (d^2*g*m*epsilon*((10.705236737008*r^3*pi^2) - (7.7599585466463*d^2*g*m*epsilon))))^-)*sign)) 2630 2 2631#1: y = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2632 (d^2*g*m*epsilon) 2633 26341-> repeat simplify symbolic 2635 2636 10*r^3*pi^2 1 2637 4*((------------- - d^2)^-)*sign 2638 (g*m*epsilon) 2 2639#1: y = 0.6666 - -------------------------------- 2640 (15*d) 2641 2642Successfully finished reading script file "test1.in". 26431-> read test2 26441-> clear all 26451-> y=(a/2)^2/b/4 2646 2647 a 2648 (-^2) 2649 2 2650#1: y = ----- 2651 (4*b) 2652 26531-> l=f*(b-y)+z*(a-f) 2654 2655#2: l = (f*(b - y)) + (z*(a - f)) 2656 26572-> m=2*(b-y)-a+f 2658 2659#3: m = (2*(b - y)) - a + f 2660 26613-> n=2*(b-y)+a-f 2662 2663#4: n = (2*(b - y)) + a - f 2664 26654-> o=l*(1/m-1/n)/2 2666 2667 1 1 2668 l*(- - -) 2669 m n 2670#5: o = --------- 2671 2 2672 26735-> eliminate l m n y 2674Eliminating variable l using solved equation #2... 2675Eliminating variable m using solved equation #3... 2676Eliminating variable n using solved equation #4... 2677Eliminating variable y using solved equation #1... 2678 2679 a 2680 (-^2) 2681 2 1 1 2682 ((f*(b - -----)) + (z*(a - f)))*(------------------------- - -------------------------) 2683 (4*b) a a 2684 (-^2) (-^2) 2685 2 2 2686 ((2*(b - -----)) - a + f) ((2*(b - -----)) + a - f) 2687 (4*b) (4*b) 2688#5: o = --------------------------------------------------------------------------------------- 2689 2 2690 26915-> simplify 2692 2693 4*((f*((16*b^3) - (b*a^2))) + (16*b^2*z*(a - f)))*(a - f) 2694#5: o = ----------------------------------------------------------- 2695 ((256*b^4) + (b^2*((128*a*f) - (96*a^2) - (64*f^2))) + a^4) 2696 26975-> copy 2698 2699 4*((f*((16*b^3) - (b*a^2))) + (16*b^2*z*(a - f)))*(a - f) 2700#6: o = ----------------------------------------------------------- 2701 ((256*b^4) + (b^2*((128*a*f) - (96*a^2) - (64*f^2))) + a^4) 2702 27035-> f 2704Equation is a degree 2 polynomial equation in f. 2705Equation was solved with the quadratic formula. 2706Solve successful: 2707 2708 1 2709 ((((4*b*a*((16*b*((2*(z + o)) - b)) + a^2))^2) + (16*b*((16*b*((b*((16*b*((b*((a^2*((4*z) + (7*o))) + (16*b*o*(z - b + o)))) - (2*a^2*((z*((2*z) + (5*o))) + (3*o^2))))) - (a^4*((7*o) + (4*z))))) + (o*a^4*(z + o)))) + (a^6*o))))^-)*sign 2710 2 2711 (------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + (2*b*a*((16*b*(b - (2*(z + o)))) - a^2))) 2712 2 2713#5: f = ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2714 (4*b*((16*b*(b - z - o)) - a^2)) 2715 27165-> simplify symbolic 2717 2718 1 a^2 2719 ((sign*(((b^2*(a^2 + (16*(o^2 + (o*z))))) + (o*((a^2*b) - (16*b^3))))^-)*((8*b^2) - ---)) - (8*b^2*a*(z + o))) 2720 a 2 2 2721#5: f = - + -------------------------------------------------------------------------------------------------------------- 2722 2 ((16*(b^3 - (b^2*(z + o)))) - (b*a^2)) 2723 27245-> 6 2725 2726 4*((f*((16*b^3) - (b*a^2))) + (16*b^2*z*(a - f)))*(a - f) 2727#6: o = ----------------------------------------------------------- 2728 ((256*b^4) + (b^2*((128*a*f) - (96*a^2) - (64*f^2))) + a^4) 2729 27306-> derivative z 2731Differentiating the RHS with respect to z and simplifying... 2732 2733 64*((b*(a - f))^2) 2734#7: o' = ----------------------------------------------------------- 2735 ((256*b^4) + (b^2*((128*a*f) - (96*a^2) - (64*f^2))) + a^4) 2736 27377-> f 2738Equation is a degree 2 polynomial equation in f. 2739Equation was solved with the quadratic formula. 2740Solve successful: 2741 2742 1 2743 ((((128*b^2*a*(1 + o'))^2) + (256*b^2*((o'*((32*b^2*((8*b^2*(1 + o')) - (a^2*(5 + (3*o'))))) + (a^4*(1 + o')))) - (64*((b*a)^2)))))^-)*sign0 2744 2 2745 -(-------------------------------------------------------------------------------------------------------------------------------------------- - (64*b^2*a*(1 + o'))) 2746 2 2747#7: f = --------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2748 (64*b^2*(1 + o')) 2749 27507-> repeat simplify symbolic 2751 2752 o' 1 a^2 2753#7: f = a + (sign0*(--------^-)*(----- - (2*b))) 2754 (1 + o') 2 (8*b) 2755 2756Successfully finished reading script file "test2.in". 27577-> read test6 27587-> ; Combine the equations for conservation of momentum and kinetic energy 27597-> ; to solve for the resulting velocity of two objects colliding head on. 27607-> clear all 27611-> ; equations for energy: 27621-> e1=1/2*mass1*velocity1_old^2 2763 2764 mass1*velocity1_old^2 2765#1: e1 = --------------------- 2766 2 2767 27681-> e2=1/2*mass2*velocity2_old^2 2769 2770 mass2*velocity2_old^2 2771#2: e2 = --------------------- 2772 2 2773 27742-> e3=1/2*mass1*velocity1_new^2 2775 2776 mass1*velocity1_new^2 2777#3: e3 = --------------------- 2778 2 2779 27803-> e4=1/2*mass2*velocity2_new^2 2781 2782 mass2*velocity2_new^2 2783#4: e4 = --------------------- 2784 2 2785 27864-> e1+e2=e3+e4 2787 2788#5: e1 + e2 = e3 + e4 2789 27905-> eliminate all 2791Eliminating variable e4 using solved equation #4... 2792Eliminating variable e3 using solved equation #3... 2793Eliminating variable e2 using solved equation #2... 2794Eliminating variable e1 using solved equation #1... 2795 2796 mass1*velocity1_old^2 mass2*velocity2_old^2 mass1*velocity1_new^2 mass2*velocity2_new^2 2797#5: --------------------- + --------------------- = --------------------- + --------------------- 2798 2 2 2 2 2799 28005-> ; equations for momentum: 28015-> #1: u1=mass1*velocity1_old 2802 2803#1: u1 = mass1*velocity1_old 2804 28051-> #2: u2=mass2*velocity2_old 2806 2807#2: u2 = mass2*velocity2_old 2808 28092-> #3: u3=mass1*velocity1_new 2810 2811#3: u3 = mass1*velocity1_new 2812 28133-> #4: u4=mass2*velocity2_new 2814 2815#4: u4 = mass2*velocity2_new 2816 28174-> u1+u2=u3+u4 2818 2819#6: u1 + u2 = u3 + u4 2820 28216-> eliminate all 2822Eliminating variable u4 using solved equation #4... 2823Eliminating variable u3 using solved equation #3... 2824Eliminating variable u2 using solved equation #2... 2825Eliminating variable u1 using solved equation #1... 2826 2827#6: (mass1*velocity1_old) + (mass2*velocity2_old) = (mass1*velocity1_new) + (mass2*velocity2_new) 2828 28296-> clear 1-4 28306-> eliminate velocity1_new 2831Solving equation #5 for velocity1_new and substituting into the current equation... 2832 2833 mass2*(velocity2_old^2 - velocity2_new^2) 1 2834#6: (mass1*velocity1_old) + (mass2*velocity2_old) = (mass1*((----------------------------------------- + velocity1_old^2)^-)*sign) + (mass2*velocity2_new) 2835 mass1 2 2836 28376-> velocity2_new 2838Equation is a degree 0.5 polynomial equation in velocity2_new. 2839Raising both equation sides to the power of 2 and expanding... 2840Equation is a degree 2 polynomial equation in velocity2_new. 2841Equation was solved with the quadratic formula. 2842Solve successful: 2843 2844 1 2845 ((((2*((mass1*velocity1_old) + (mass2*velocity2_old)))^2) + (4*velocity2_old*((mass1*((mass1*(velocity2_old - (2*velocity1_old))) - (2*mass2*velocity1_old))) - (mass2^2*velocity2_old))))^-)*sign0 2846 2 2847 (--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + (mass1*velocity1_old) + (mass2*velocity2_old)) 2848 2 2849#6: velocity2_new = ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2850 (mass1 + mass2) 2851 28526-> simplify 2853 2854 1 2855 (((((mass1*(velocity1_old - velocity2_old))^2)^-)*sign0) + (mass1*velocity1_old) + (mass2*velocity2_old)) 2856 2 2857#6: velocity2_new = --------------------------------------------------------------------------------------------------------- 2858 (mass1 + mass2) 2859 28606-> velocity2_new = ((sign*((mass1*(velocity1_old-velocity2_old))^2)^.5)+(mass1*velocity1_old)+(mass2*velocity2_old))/(mass1+mass2) 2861 2862 1 2863 ((sign*(((mass1*(velocity1_old - velocity2_old))^2)^-)) + (mass1*velocity1_old) + (mass2*velocity2_old)) 2864 2 2865#7: velocity2_new = -------------------------------------------------------------------------------------------------------- 2866 (mass1 + mass2) 2867 28687-> compare 6 2869Comparing #6 with #7... 2870Equations are identical. 2871Successfully finished reading script file "test6.in". 28727-> clear all 28731-> read simplify 28741-> 28751-> ; Some complete simplifications Mathomatic has always been able to do. 28761-> ; The result is the smallest expression that gives exactly the same results. 28771-> 28781-> 2*(x^2-y^2)^16-(x^2-y^2)^15*(2x^2-3) 2879 2880#1: (2*((x^2 - y^2)^16)) - (((x^2 - y^2)^15)*((2*x^2) - 3)) 2881 28821-> simplify ; Simplify the previously entered expression above. 2883 2884#1: ((x^2 - y^2)^15)*(3 - (2*y^2)) 2885 28861-> repeat echo * 2887******************************************************************************* 28881-> a^3/((a-b)*(a-c))+b^3/((b-c)*(b-a))+c^3/((c-a)*(c-b)) 2889 2890 a^3 b^3 c^3 2891#2: ----------------- + ----------------- + ----------------- 2892 ((a - b)*(a - c)) ((b - c)*(b - a)) ((c - a)*(c - b)) 2893 28942-> simplify ; Simplify algebraic fractions. 2895 2896#2: a + b + c 2897 28982-> repeat echo * 2899******************************************************************************* 29002-> (x^6+a^6)*(x+1)/((x^6+a^6)*(x^2-a^2)+a^2*x^2*(x^4-a^4))+a^2*x^2*(x+1)/(x^6-a^6-a^2*x^2*(x^2-a^2)) 2901 2902 (x^6 + a^6)*(x + 1) a^2*x^2*(x + 1) 2903#3: --------------------------------------------------- + ----------------------------------- 2904 (((x^6 + a^6)*(x^2 - a^2)) + (a^2*x^2*(x^4 - a^4))) (x^6 - a^6 - (a^2*x^2*(x^2 - a^2))) 2905 29063-> simplify 2907 2908 (x + 1) 2909#3: ----------- 2910 (x^2 - a^2) 2911 29123-> repeat echo * 2913******************************************************************************* 29143-> (1-(1-(y+1)/(x+y+1))/(1-x/(x+y+1)))/((y+1)^2-x/(1+x/(y-x+1))*(x*(y+1)/(y-x+1)-x)) 2915 2916 (y + 1) 2917 (1 - -----------) 2918 (x + y + 1) 2919 (1 - -----------------) 2920 x 2921 (1 - -----------) 2922 (x + y + 1) 2923#4: ----------------------------------- 2924 x*(y + 1) 2925 x*(----------- - x) 2926 (y - x + 1) 2927 (((y + 1)^2) - -------------------) 2928 x 2929 (1 + -----------) 2930 (y - x + 1) 2931 29324-> simplify fraction ; Any complex fraction can be reduced to a simple fraction with this command. 2933 2934 1 2935#4: ------------------------------------- 2936 (1 + y^2 + (2*y) + (x*(y + 1)) + x^2) 2937 29384-> repeat echo * 2939******************************************************************************* 29404-> ((2*((x*(x+(((x^2)-1)^(1/2))))-1))+1)/((2*x*((x^2)-1))+((((x^2)-1)^(1/2))*((2*(x^2))-1))) 2941 2942 1 2943 ((2*((x*(x + ((x^2 - 1)^-))) - 1)) + 1) 2944 2 2945#5: ------------------------------------------------- 2946 1 2947 ((2*x*(x^2 - 1)) + (((x^2 - 1)^-)*((2*x^2) - 1))) 2948 2 2949 29505-> simplify ; Simplify an expression containing radicals (roots). 2951 2952 1 2953#5: ------------- 2954 1 2955 ((x^2 - 1)^-) 2956 2 2957 29585-> ; Rationalizing the denominator was required to simplify the above expression. 29595-> repeat echo * 2960******************************************************************************* 29615-> ((x - 2*y)^4/(x^2 - 4*y^2)^2 + 1)*(y + a)*(2*y + x) / (4*y^2 + x^2) 2962 2963 ((x - (2*y))^4) 2964 (------------------- + 1)*(y + a)*((2*y) + x) 2965 ((x^2 - (4*y^2))^2) 2966#6: --------------------------------------------- 2967 ((4*y^2) + x^2) 2968 29696-> repeat simplify 2970 2971 2*(y + a) 2972#6: ----------- 2973 ((2*y) + x) 2974 2975Successfully finished reading script file "simplify.in". 29766-> read heron 29776-> clear all 29781-> ; This Mathomatic script shows two reverse derivations of Heron's formula. 29791-> ; This is Heron's formula for the area of any triangle, 29801-> ; given side lengths "a", "b", and "c". 29811-> 29821-> 2s = a+b+c 2983 2984#1: 2*s = a + b + c 2985 29861-> triangle_area = (s*(s-a)*(s-b)*(s-c))^.5 2987 2988 1 2989#2: triangle_area = (s*(s - a)*(s - b)*(s - c))^- 2990 2 2991 29922-> eliminate s ; Heron's formula: 2993Solving equation #1 for s and substituting into the current equation... 2994 2995 (a + b + c) (a + b + c) (a + b + c) 2996 (a + b + c)*(----------- - a)*(----------- - b)*(----------- - c) 2997 2 2 2 1 2998#2: triangle_area = -----------------------------------------------------------------^- 2999 2 2 3000 30012-> simplify ; Heron's formula simplified by Mathomatic: 3002 3003 1 3004 (((2*((a^2*(b^2 + c^2)) + ((b*c)^2))) - a^4 - b^4 - c^4)^-) 3005 2 3006#2: triangle_area = ----------------------------------------------------------- 3007 4 3008 30092-> pause 30102-> ; This is how we arrive at Heron's formula for the area 30112-> ; of any triangle, given side lengths a, b, and c, using the formula 30122-> ; for the area of a trapezoid with side lengths a, b, c, and d, 30132-> ; where a and c are the parallel sides (a is the longer parallel side). 30142-> 30152-> ; A trapezoid is a quadrilateral with 30162-> ; two sides that are parallel to each other. 30172-> 30182-> ; Formula for the area of a trapezoid that is not a parallelogram: 30192-> trapezoid_area=(a+c)/(4*(a-c))*((a+b-c+d)*(a-b-c+d)*(a+b-c-d)*(-a+b+c+d))^.5 3020 3021 1 3022 (a + c)*(((a + b - c + d)*(a - b - c + d)*(a + b - c - d)*(b - a + c + d))^-) 3023 2 3024#3: trapezoid_area = ----------------------------------------------------------------------------- 3025 (4*(a - c)) 3026 30273-> pause 30283-> copy 3029 3030 1 3031 (a + c)*(((a + b - c + d)*(a - b - c + d)*(a + b - c - d)*(b - a + c + d))^-) 3032 2 3033#4: trapezoid_area = ----------------------------------------------------------------------------- 3034 (4*(a - c)) 3035 30363-> replace c with 0 ; make the shorter parallel side length = 0 3037 3038 1 3039 (((a + b + d)*(a - b + d)*(a + b - d)*(b - a + d))^-) 3040 2 3041#3: trapezoid_area = ----------------------------------------------------- 3042 4 3043 30443-> replace d with c ; Heron's formula in its simplest form: 3045 3046 1 3047 (((a + b + c)*(a - b + c)*(a + b - c)*(b - a + c))^-) 3048 2 3049#3: trapezoid_area = ----------------------------------------------------- 3050 4 3051 30523-> replace trapezoid_area with triangle_area 3053 3054 1 3055 (((a + b + c)*(a - b + c)*(a + b - c)*(b - a + c))^-) 3056 2 3057#3: triangle_area = ----------------------------------------------------- 3058 4 3059 30603-> pause Please press the Enter key to verify the result. 30613-> copy 3062 3063 1 3064 (((a + b + c)*(a - b + c)*(a + b - c)*(b - a + c))^-) 3065 2 3066#5: triangle_area = ----------------------------------------------------- 3067 4 3068 30693-> display 2 3070 3071 1 3072 (((2*((a^2*(b^2 + c^2)) + ((b*c)^2))) - a^4 - b^4 - c^4)^-) 3073 2 3074#2: triangle_area = ----------------------------------------------------------- 3075 4 3076 30773-> compare 5 with 2 ; simplify and compare the result with Heron's formula: 3078Comparing #5 with #2... 3079Simplifying both equations... 3080Equations are identical. 30813-> clear 5 30823-> pause 30833-> 30843-> ; This is how we arrive at Heron's formula for the area 30853-> ; of any triangle, given side lengths a, b, and c, using 30863-> ; Brahmagupta's formula for the area of a cyclic quadrilateral, 30873-> ; making one side length equal zero, to make a cyclic triangle. 30883-> ; Since all triangles are cyclic (can be circumscribed by a circle), 30893-> ; this gives the area for any triangle. 30903-> 30913-> 2s=a+b+c+d ; cyclic quadrilateral side lengths are a, b, c, and d 3092 3093#5: 2*s = a + b + c + d 3094 30955-> cyclic_area = ((s-a)*(s-b)*(s-c)*(s-d))^.5 3096 3097 1 3098#6: cyclic_area = ((s - a)*(s - b)*(s - c)*(s - d))^- 3099 2 3100 31016-> eliminate s ; Brahmagupta's formula: 3102Solving equation #5 for s and substituting into the current equation... 3103 3104 (a + b + c + d) (a + b + c + d) (a + b + c + d) (a + b + c + d) 1 3105#6: cyclic_area = ((--------------- - a)*(--------------- - b)*(--------------- - c)*(--------------- - d))^- 3106 2 2 2 2 2 3107 31086-> pause 31096-> copy 3110 3111 (a + b + c + d) (a + b + c + d) (a + b + c + d) (a + b + c + d) 1 3112#7: cyclic_area = ((--------------- - a)*(--------------- - b)*(--------------- - c)*(--------------- - d))^- 3113 2 2 2 2 2 3114 31156-> replace d with 0 ; make one side length zero to get Heron's formula: 3116 3117 (a + b + c) (a + b + c) (a + b + c) 3118 (----------- - a)*(----------- - b)*(----------- - c)*(a + b + c) 3119 2 2 2 1 3120#6: cyclic_area = -----------------------------------------------------------------^- 3121 2 2 3122 31236-> pause Please press the Enter key to verify the result. 31246-> compare 2 ; simplify and compare the result with Heron's formula: 3125Comparing #2 with #6... 3126Simplifying both equations... 3127Variable triangle_area in the first equation 3128is equal to cyclic_area in the second equation. 31296-> clear 31306-> clear 1 5 3131Successfully finished reading script file "heron.in". 31326-> clear all 31331-> read radius 31341-> 31351-> ; Some more fun formulas. These are very similar to Heron's formula 31361-> ; for the area of a triangle (see "heron.in"). a, b, and c are the 31371-> ; lengths of the sides of the triangle. 31381-> 31391-> s=(a+b+c)/2 ; semiperimeter 3140 3141 (a + b + c) 3142#1: s = ----------- 3143 2 3144 31451-> ; radius of a circle inscribed in a triangle, called an incircle: 31461-> inradius=(s*(s-a)*(s-b)*(s-c))^.5/s 3147 3148 1 3149 ((s*(s - a)*(s - b)*(s - c))^-) 3150 2 3151#2: inradius = ------------------------------- 3152 s 3153 31542-> eliminate s 3155Eliminating variable s using solved equation #1... 3156 3157 (a + b + c) (a + b + c) (a + b + c) 3158 (a + b + c)*(----------- - a)*(----------- - b)*(----------- - c) 3159 2 2 2 1 3160 2*(-----------------------------------------------------------------^-) 3161 2 2 3162#2: inradius = ----------------------------------------------------------------------- 3163 (a + b + c) 3164 31652-> simplify 3166 3167 8*((b^2*c) + (b*c^2)) 1 3168 (((2*((b*(a - (3*c))) + (a*c))) - a^2 + --------------------- - b^2 - c^2)^-) 3169 (a + b + c) 2 3170#2: inradius = ----------------------------------------------------------------------------- 3171 2 3172 31732-> 31742-> ; The following is the equation for the radius of a circle circumscribing 31752-> ; a triangle, called a circumcircle, which is a circle that passes through 31762-> ; all the vertices of a polygon. 31772-> radius=a*b*c/(4*(s*(s-a)*(s-b)*(s-c))^.5) 3178 3179 a*b*c 3180#3: radius = ----------------------------------- 3181 1 3182 (4*((s*(s - a)*(s - b)*(s - c))^-)) 3183 2 3184 31853-> eliminate s 3186Eliminating variable s using solved equation #1... 3187 3188 a*b*c 3189#3: radius = ------------------------------------------------------------------------- 3190 (a + b + c) (a + b + c) (a + b + c) 3191 (a + b + c)*(----------- - a)*(----------- - b)*(----------- - c) 3192 2 2 2 1 3193 (4*(-----------------------------------------------------------------^-)) 3194 2 2 3195 31963-> simplify 3197 3198 a*b*c 3199#3: radius = ----------------------------------------------------------- 3200 1 3201 (((2*((a^2*(b^2 + c^2)) + ((b*c)^2))) - a^4 - b^4 - c^4)^-) 3202 2 3203 32043-> #s ; Search backwards for the s variable; "/" searches forwards. 3205Searching backwards for variable. 3206 3207 (a + b + c) 3208#1: s = ----------- 3209 2 3210 32111-> clear ; No longer needed. 32121-> display all 3213 3214 8*((b^2*c) + (b*c^2)) 1 3215 (((2*((b*(a - (3*c))) + (a*c))) - a^2 + --------------------- - b^2 - c^2)^-) 3216 (a + b + c) 2 3217#2: inradius = ----------------------------------------------------------------------------- 3218 2 3219 3220 3221 a*b*c 3222#3: radius = ----------------------------------------------------------- 3223 1 3224 (((2*((a^2*(b^2 + c^2)) + ((b*c)^2))) - a^4 - b^4 - c^4)^-) 3225 2 3226 3227Successfully finished reading script file "radius.in". 32281-> clear all 32291-> read pyth3d 32301-> 32311-> ; This arrives at the distance between two points in 3D space from the 32321-> ; Pythagorean theorem (distance between two points on a 2D plane). 32331-> ; The coordinate of point 1, 2D: (x1, y1), 3D: (x1, y1, z1). 32341-> ; The coordinate of point 2, 2D: (x2, y2), 3D: (x2, y2, z2). 32351-> 32361-> distance2D^2=(x1-x2)^2+(y1-y2)^2 ; Distance formula for a 2D Cartesian plane. 3237 3238#1: distance2D^2 = ((x1 - x2)^2) + ((y1 - y2)^2) 3239 32401-> distance3D^2=distance2D^2+(z1-z2)^2 ; Add another leg. 3241 3242#2: distance3D^2 = distance2D^2 + ((z1 - z2)^2) 3243 32442-> eliminate distance2D ; Combine the two equations. 3245Solving equation #1 for distance2D and substituting into the current equation... 3246 3247#2: distance3D^2 = ((x1 - x2)^2) + ((y1 - y2)^2) + ((z1 - z2)^2) 3248 32492-> distance3D ; Solve to get the distance in 3D Cartesian space. 3250Solve successful: 3251 3252 1 3253#2: distance3D = ((((x1 - x2)^2) + ((y1 - y2)^2) + ((z1 - z2)^2))^-)*sign0 3254 2 3255 3256Successfully finished reading script file "pyth3d.in". 32572-> clear all 32581-> read distance 32591-> 32601-> ; This input arrives at the shortest distance between a point and a line 32611-> ; in 2 dimensions. The point is at (x0, y0) in cartesian coordinates. 32621-> ; (x, y) are the points on the line. 32631-> 32641-> a*x+b*y+c=0 ; equation of the line 3265 3266#1: (a*x) + (b*y) + c = 0 3267 32681-> y ; solve for y 3269Solve successful: 3270 3271 -((a*x) + c) 3272#1: y = ------------ 3273 b 3274 32751-> unfactor fraction ; equation of the line in slope-intercept form: 3276 3277 -c a*x 3278#1: y = -- - --- 3279 b b 3280 32811-> distance=|a*(x-x0)+b*(y-y0)|/(a^2+b^2)^.5 3282 3283 1 3284 ((((a*(x - x0)) + (b*(y - y0)))^2)^-) 3285 2 3286#2: distance = ------------------------------------- 3287 1 3288 ((a^2 + b^2)^-) 3289 2 3290 32912-> eliminate y ; Combine the above two equations to eliminate x and y. 3292Eliminating variable y using solved equation #1... 3293 3294 -c a*x 1 3295 ((((a*(x - x0)) + (b*(-- - --- - y0)))^2)^-) 3296 b b 2 3297#2: distance = -------------------------------------------- 3298 1 3299 ((a^2 + b^2)^-) 3300 2 3301 33022-> simplify ; The beautiful answer is: 3303 3304 (((a*x0) + c + (b*y0))^2) 1 3305#2: distance = -------------------------^- 3306 (a^2 + b^2) 2 3307 33082-> ; Replacing a with -m, b with 1, and c with -b results in the shortest distance from the line y=m*x+b. 3309Successfully finished reading script file "distance.in". 33102-> clear all 33111-> read circles 33121-> 33131-> ; This is a simple example of eliminate command usage. 33141-> ; Combine the equations for 2 circles of radius "r" on a 2D Cartesian plane 33151-> ; to find the points of intersection (x, y). 33161-> 33171-> (x-x1)^2+(y-y1)^2=r^2 ; circle of radius "r" with center at (x1, y1) 3318 3319#1: ((x - x1)^2) + ((y - y1)^2) = r^2 3320 33211-> (x-x2)^2+(y-y2)^2=r^2 ; circle of radius "r" with center at (x2, y2) 3322 3323#2: ((x - x2)^2) + ((y - y2)^2) = r^2 3324 33252-> eliminate x ; combine the two equations, removing the x variable from the result 3326Solving equation #1 for x and substituting into the current equation... 3327 3328 1 3329#2: (((((r^2 - ((y - y1)^2))^-)*sign) + x1 - x2)^2) + ((y - y2)^2) = r^2 3330 2 3331 33322-> solve for y 3333Equation is a degree 0.5 polynomial equation in y. 3334Raising both equation sides to the power of 2 and expanding... 3335Equation is a degree 2 polynomial equation in y. 3336Equation was solved with the quadratic formula. 3337Solve successful: 3338 3339 1 3340 ((((4*((y1*((x2*((2*x1) - x2)) - x1^2 + (y1*(y2 - y1)) + y2^2)) + (y2*((x1*((2*x2) - x1)) - x2^2 - y2^2))))^2) + (16*((y2*((y2*((y1*((y1*((2*((x2*((2*x1) - x2)) - x1^2)) + (y2*(y2 - (4*y1))) + y1^2)) + (2*y2*((2*((x1*(x1 - (2*x2))) + x2^2)) + y2^2)))) + (x1*((x1*((3*((x1*((4*x2) - x1)) - y2^2 - (6*x2^2))) + (4*r^2))) + (2*x2*((6*x2^2) + (3*y2^2) - (4*r^2))))) + (x2^2*((4*r^2) - (3*(x2^2 + y2^2)))) - y2^4)) + (2*y1*((y1^2*((2*((x2*(x2 - (2*x1))) + x1^2)) + y1^2)) + (x1*((x1*((x1*(x1 - (4*x2))) + (6*x2^2) - (4*r^2))) + (4*x2*((2*r^2) - x2^2)))) + (x2^2*(x2^2 - (4*r^2))))))) + (y1^2*((y1^2*((3*((x2*((2*x1) - x2)) - x1^2)) - y1^2)) + (x1*((x1*((3*((x1*((4*x2) - x1)) - (6*x2^2))) + (4*r^2))) + (4*x2*((3*x2^2) - (2*r^2))))) + (x2^2*((4*r^2) - (3*x2^2))))) + (x2*((x2*((x1*((x1*((5*((x1*((4*x2) - (3*x1))) - (3*x2^2))) + (24*r^2))) + (2*x2*((3*x2^2) - (8*r^2))))) + (x2^2*((4*r^2) - x2^2)))) + (2*x1^3*((3*x1^2) - (8*r^2))))) + (x1^4*((4*r^2) - x1^2)))))^-)*sign0 3341 2 3342 (------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + (2*((y1*((x2*(x2 - (2*x1))) + x1^2 + (y1*(y1 - y2)) - y2^2)) + (y2*((x1*(x1 - (2*x2))) + x2^2 + y2^2))))) 3343 2 3344#2: y = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3345 (4*((y2*(y2 - (2*y1))) + y1^2 + (x2*(x2 - (2*x1))) + x1^2)) 3346 33472-> repeat simplify 3348 3349 4*r^2 1 3350 (y2 + y1 + (((((x1 - x2)^2)*(----------------------------------------------------- - 1))^-)*sign0)) 3351 (y2^2 - (2*((y2*y1) + (x2*x1))) + x2^2 + y1^2 + x1^2) 2 3352#2: y = --------------------------------------------------------------------------------------------------- 3353 2 3354 3355Successfully finished reading script file "circles.in". 33562-> clear all 33571-> read ellipse 33581-> 33591-> ; This is an equation for an ellipse that was created using the rule 33601-> ; that the sum of the distances from any point on the perimeter (x, y) 33611-> ; to the two foci: (x1, y1) and (x2, y2), is a constant k. This can 33621-> ; represent any ellipse of any orientation on the Cartesian plane. 33631-> 33641-> k = ((x1-x)^2+(y1-y)^2)^0.5 + ((x2-x)^2+(y2-y)^2)^0.5 3365 3366 1 1 3367#1: k = ((((x1 - x)^2) + ((y1 - y)^2))^-) + ((((x2 - x)^2) + ((y2 - y)^2))^-) 3368 2 2 3369 33701-> 33711-> ; A simplified equation for a right ellipse centered at the origin (0, 0) 33721-> ; of the Cartesian plane: 33731-> 33741-> 1 = x^2/radius1^2 + y^2/radius2^2 3375 3376 x^2 y^2 3377#2: 1 = --------- + --------- 3378 radius1^2 radius2^2 3379 33802-> ; The x-intercepts are radius1 and -radius1 because y=0 there. 33812-> ; The y-intercepts are radius2 and -radius2 because x=0 there. 3382Successfully finished reading script file "ellipse.in". 33832-> solve all y 3384Equation is a degree 0.5 polynomial equation in y. 3385Raising both equation sides to the power of 2 and expanding... 3386Equation is a degree 0.5 polynomial equation in y. 3387Raising both equation sides to the power of 2 and expanding... 3388Equation is a degree 2 polynomial equation in y. 3389Equation was solved with the quadratic formula. 3390Solve successful: 3391 3392 1 3393 ((((4*((2*x*(y1 - y2)*(x1 - x2)) + (y2*((y2*(y1 - y2)) - x2^2 + x1^2 + y1^2 + k^2)) + (y1*(x2^2 - x1^2 - y1^2 + k^2))))^2) + (64*((y1*((y1*((x2*((x2*((x*(x2 - x1 - x)) - (y1*y2))) - (x*(x1^2 + y1^2)))) + (x*((x1*((x1*(x1 - x)) + y1^2)) + (x*k^2))) + (x1^2*(k^2 + (y1*y2))) - (y1*y2*(y2^2 + k^2)))) + (y2*((x2^2*(y2^2 - x1^2 - k^2)) - (y2^2*(k^2 + x1^2)) - ((x1*k)^2))))) + (k^2*((x2*((x2*((x*(x + x1 - x2)) + y2^2)) + (x*(k^2 + x1^2)))) + (x*((x1*((x1*(x - x1)) + k^2)) + (x*(y2^2 - k^2)))))) + (y2^2*x*((x2*((x2*(x2 - x1 - x)) + y2^2 - x1^2)) + (x1*((x1*(x1 - x)) - y2^2)))))) + (32*((y1*((y1*((x2^2*(x1^2 + y1^2)) + (y1^2*((y1*y2) - x1^2)) + ((y2*k)^2))) + (y2*(x2^4 + y2^4 + x1^4 + k^4)))) - (k^2*((x2^2*(x1^2 + k^2)) + ((k*x1)^2))) + (y2^2*((x2^2*(x1^2 - y2^2)) + ((y2*x1)^2))))) + (16*((y1*((y1*((x2*((8*x*((x*x1) + (y1*y2))) - x2^3)) - (x1*((8*x*(k^2 + (y1*y2))) + x1^3)) + (y2^2*(y2^2 + y1^2)) + (y1^2*((3*k^2) - y1^2)) - (3*k^4))) + (8*y2*x*((x2*((x2*(x + x1 - x2)) + k^2 + (x1*(x1 - (2*x))) - y2^2)) + (x1*(y2^2 + (x1*(x - x1)) + k^2)) - (x*k^2))))) + (k^2*((x2*(x2^3 - (8*x*((x*x1) + y2^2)))) + (3*y2^2*(y2^2 - k^2)) + x1^4 + k^4)) + (y2^2*((x2*((8*x^2*x1) - x2^3)) - y2^4 - x1^4)))))^-)*sign 3394 2 3395 (-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + (4*x*(y2 - y1)*(x1 - x2)) + (2*((y2*((y2*(y2 - y1)) + x2^2 - x1^2 - y1^2 - k^2)) + (y1*(x1^2 - x2^2 + y1^2 - k^2))))) 3396 2 3397#1: y = --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3398 (4*((y1*(y1 - (2*y2))) - k^2 + y2^2)) 3399 3400Solve successful: 3401 3402 x 1 3403#2: y = ((-((-------^2) - 1))^-)*sign0*radius2 3404 radius1 2 3405 34062-> simplify all 3407 3408 1 3409 ((((k^2*(x1^2 + (4*(x^2 - (x*x2))) + y1^2 + x2^2 + y2^2 + (2*((x1*(x2 - (2*x))) - (y1*y2))))) - k^4)*(y1^2 - (2*((y1*y2) + (x2*x1))) + y2^2 + x2^2 + x1^2 - k^2))^-)*sign 3410 2 (x1 + x2) 3411 (------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + ((y1 - y2)*(x - ---------)*(x2 - x1))) 3412 (y1 + y2) 2 2 3413#1: y = --------- + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3414 2 (y1^2 - (2*y1*y2) - k^2 + y2^2) 3415 3416 3417 x 1 3418#2: y = ((1 - (-------^2))^-)*sign0*radius2 3419 radius1 2 3420 34212-> pause 34222-> clear all 34231-> help examples 3424******************************************************************************* 34251-> ; Example 1: 34261-> ; Here the derivative of the absolute value function is computed. 34271-> ; Expressions are entered by just typing them in: 34281-> |x| ; The absolute value of x 3429 3430 1 3431#1: (x^2)^- 3432 2 3433 34341-> derivative ; The result gives the sign of x: 3435Differentiating with respect to x and simplifying... 3436 3437 x 3438#2: --------- 3439 1 3440 ((x^2)^-) 3441 2 3442 34432-> pause 34442-> repeat echo - 3445------------------------------------------------------------------------------- 34462-> ; Example 2: 34472-> ; Here the calculate command is used to plug values into a solved formula. 34482-> ; A common temperature conversion formula (from "help conversions"): 34492-> fahrenheit = (9*celsius/5) + 32 3450 3451 9*celsius 3452#3: fahrenheit = --------- + 32 3453 5 3454 34553-> repeat calculate ; plug in values until an empty line is entered 3456 fahrenheit = (1.8*celsius) + 32, with fractions it is: (9*celsius/5) + 32 34573-> 34583-> ; Solve for the other variable and simplify the result: 34593-> solve for celsius 3460Solve successful: 3461 3462 -5*(32 - fahrenheit) 3463#3: celsius = -------------------- 3464 9 3465 34663-> simplify 3467 3468 5*(fahrenheit - 32) 3469#3: celsius = ------------------- 3470 9 3471 34723-> repeat calculate ; plug in values until an empty line is entered 3473 celsius = (0.55555555555556*fahrenheit) - 17.777777777778, with fractions it is: (5*fahrenheit/9) - (160/9) 34743-> 34753-> variables count; count all variables that occur in expressions 3476fahrenheit /* count = 1 */ 3477celsius /* count = 1 */ 34783-> pause 34793-> repeat echo - 3480------------------------------------------------------------------------------- 34813-> ; Example 3: 34823-> ; Expand the following to polynomial form, then refactor and differentiate: 34833-> (x+y+z)^3 3484 3485#4: (x + y + z)^3 3486 34874-> expand count ; Expand and count the resulting number of terms: 3488 3489#4: x^3 + (3*x^2*y) + (3*x^2*z) + (3*x*y^2) + (6*x*y*z) + (3*x*z^2) + y^3 + (3*y^2*z) + (3*y*z^2) + z^3 3490 3491#4: Expression consists of a total of 10 terms. 34924-> pause 34934-> simplify ; refactor: 3494 3495#4: (x + y + z)^3 3496 34974-> derivative x ; here is the derivative, with respect to x: 3498Differentiating with respect to x and simplifying... 3499 3500#5: 3*((x + y + z)^2) 3501 35025-> expand count ; and its term count, when expanded: 3503 3504#5: (3*x^2) + (6*x*y) + (6*x*z) + (3*y^2) + (6*y*z) + (3*z^2) 3505 3506#5: Expression consists of a total of 6 terms. 35075-> clear all 35081-> help conversions 3509******************************************************************************* 3510Help conversions: 3511----------------- 3512Commonly used metric/English conversions. 3513Select the equation you want (for example, with "1" or "/celsius") 3514and type the unit name you want, to solve for it (like "celsius"). 3515Then type "repeat calculate" for units conversion and trying different values. 3516These values are correct for the US and UK. 3517------------------------------------------- 35181-> ; Temperature 35191-> fahrenheit = (9*celsius/5) + 32 3520 3521 9*celsius 3522#1: fahrenheit = --------- + 32 3523 5 3524 35251-> kelvin = celsius + 273.15 3526 3527 5463 3528#2: kelvin = celsius + ---- 3529 20 3530 35312-> ; Distance 35322-> inches = centimeters/2.54 3533 3534 50*centimeters 3535#3: inches = -------------- 3536 127 3537 35383-> miles = kilometers/1.609344 3539 3540#4: miles = 0.62137119223733*kilometers 3541 35424-> ; Weight 35434-> pounds = kilograms/0.45359237 3544 3545#5: pounds = 2.2046226218488*kilograms 3546 35475-> simplify all 3548 3549 9*celsius 3550#1: fahrenheit = --------- + 32 3551 5 3552 3553 3554 5463 3555#2: kelvin = celsius + ---- 3556 20 3557 3558 3559 50*centimeters 3560#3: inches = -------------- 3561 127 3562 3563 3564#4: miles = 0.62137119223733*kilometers 3565 3566 3567#5: pounds = 2.2046226218488*kilograms 3568 35695-> clear all 35701-> help geometry 3571******************************************************************************* 3572Help geometry: 3573-------------- 3574Commonly used standard (Euclidean) geometric formulas 3575----------------------------------------------------- 35761-> ; Triangle area, "b" is the "base" side: 35771-> triangle_area = b*height/2 3578 3579 b*height 3580#1: triangle_area = -------- 3581 2 3582 35831-> ; Here is Heron's formula for the area of any triangle 35841-> ; given all three side lengths ("a", "b", and "c"): 35851-> triangle_area = (((a + b + c)*(a - b + c)*(a + b - c)*(b - a + c))^(1/2))/4 3586 3587 1 3588 (((a + b + c)*(a - b + c)*(a + b - c)*(b - a + c))^-) 3589 2 3590#2: triangle_area = ----------------------------------------------------- 3591 4 3592 35932-> 35942-> ; Rectangle of length "l" and width "w": 35952-> rectangle_area = l*w 3596 3597#3: rectangle_area = l*w 3598 35993-> rectangle_perimeter = 2*l + 2*w 3600 3601#4: rectangle_perimeter = (2*l) + (2*w) 3602 36034-> 36044-> ; Trapezoid of parallel sides "a" and "b", 36054-> ; and the "distance" between them: 36064-> trapezoid_area = distance*(a + b)/2 3607 3608 distance*(a + b) 3609#5: trapezoid_area = ---------------- 3610 2 3611 36125-> 36135-> ; Circle of radius "r": 36145-> circle_area = pi*r^2 3615 3616#6: circle_area = pi*r^2 3617 36186-> circle_perimeter = 2*pi*r 3619 3620#7: circle_perimeter = 2*pi*r 3621 36227-> 36237-> ; 3D rectangular solid of length "l", width "w", and height "h": 36247-> brick_volume = l*w*h 3625 3626#8: brick_volume = l*w*h 3627 36288-> brick_surface_area = 2*l*w + 2*l*h + 2*w*h 3629 3630#9: brick_surface_area = (2*l*w) + (2*l*h) + (2*w*h) 3631 36329-> 36339-> ; 3D sphere of radius "r": 36349-> sphere_volume = 4/3*pi*r^3 3635 3636 4*pi*r^3 3637#10: sphere_volume = -------- 3638 3 3639 364010-> sphere_surface_area = 4*pi*r^2 3641 3642#11: sphere_surface_area = 4*pi*r^2 3643 364411-> 364511-> ; Convex 2D polygon with straight sides, 364611-> ; sum of all interior angles formula in degree, radian, and gradian units: 364711-> sum_degrees = (sides - 2)*180 3648 3649#12: sum_degrees = 180*(sides - 2) 3650 365112-> sum_radians = (sides - 2)*pi 3652 3653#13: sum_radians = (sides - 2)*pi 3654 365513-> sum_grads = (sides - 2)*180*10/9 ; Rarely used gradian formula. 3656 3657#14: sum_grads = 200*(sides - 2) 3658 365914-> ; "sides" is the number of sides of any convex 2D polygon. 366014-> ; Convex means that all interior angles are less than 180 degrees. 366114-> ; Type "elim sides" to get the radians/degrees/grads conversion formulas. 366214-> simplify all 3663 3664 b*height 3665#1: triangle_area = -------- 3666 2 3667 3668 3669 1 3670 (((2*((b^2*(a^2 + c^2)) + ((a*c)^2))) - a^4 - b^4 - c^4)^-) 3671 2 3672#2: triangle_area = ----------------------------------------------------------- 3673 4 3674 3675 3676#3: rectangle_area = l*w 3677 3678 3679#4: rectangle_perimeter = 2*(l + w) 3680 3681 3682 distance*(a + b) 3683#5: trapezoid_area = ---------------- 3684 2 3685 3686 3687#6: circle_area = pi*r^2 3688 3689 3690#7: circle_perimeter = 2*pi*r 3691 3692 3693#8: brick_volume = l*w*h 3694 3695 3696#9: brick_surface_area = 2*((l*(w + h)) + (w*h)) 3697 3698 3699 4*pi*r^3 3700#10: sphere_volume = -------- 3701 3 3702 3703 3704#11: sphere_surface_area = 4*pi*r^2 3705 3706 3707#12: sum_degrees = 180*(sides - 2) 3708 3709 3710#13: sum_radians = pi*(sides - 2) 3711 3712 3713#14: sum_grads = 200*(sides - 2) 3714 371514-> quit 3716ByeBye!! from Mathomatic. 3717