計算機科学のブログ

知識を広げる 代数操作と方程式の解 因数分解、出力、Traditional Form、一般解集合、Reduce、近似、FindRoot

ハンズ・オン・スタートMathematica® -Wolfram言語™によるプログラミング (C・ヘイスティング(著)、K・ミショー(著)、M・モリソン(著)、ウルフラム・リサーチ(翻訳)、丸善出版)の第2部(知識を広げる)、第14章(代数操作と方程式の解)の練習問題1、2、3、4、5、6、7、8、9、10の解答を求めてみる。

Factor[x^3+3x^2+x+3]
Output
Plot[%, {x, -5, 5}]
Output
Plot[x^3+3x^2+x+3, {x, -5, 5}, PlotRange -> {-5, 5}]
Output
TraditionalForm[(3 + x) (1 + x^2)]
Output

solve x^2+7x-8 == 0

Solve[x^2 + 7 x - 8 == 0, x]
Output

solve 3x+5y=8 and x-2y=7

Solve[{3 x + 5 y == 8, x - 2 y == 7}, {x, y}]
Output
N[%,10]
Output
Solve[x^2+5x+9 == 14, x]
Output
results = x/. %
Output
N[results,4]
{-5.854, 0.8541}
Reduce[3x^4-5y^3 == 11]
Output
Plot3D[{3x^4-5y^3, 11}, {x, -20, 20}, {y, -20, 20}, PlotRange -> {-20, 20}]
Output
Plot3D[{3x^4-5y^3}, {x, 0, 15}, {y, 0, 15}, PlotRange -> {0, 15}]
Output
Plot3D[{3x^4-5y^3}, {x, 0, 2}, {y, 0, 2}, PlotRange -> {0, 15}]
Output
Plot3D[{3x^4-5y^3, 11}, {x, 0, 2}, {y, 0, 2}, PlotRange -> {0, 15}]
Output
expr[x_] := 3 Sin[3x] + 2Cos[x^2];
Plot[expr[x], {x, -5, 5}]
FindRoot[expr[x], {x, 0}]
Output
Output