赞
踩
若要获得更好的阅读体验,请前往 链接。
求点赞。
做因式分解 f ( x ) = x 4 − 5 x 3 + 5 x 2 + 5 x − 6 f(x) = x^{4} - 5x^{3} + 5x^{2} + 5x - 6 f(x)=x4−5x3+5x2+5x−6.
代码:
syms x;
f = x^4-5*x^3+5*x^2+5*x-6;
factor(f)
输出:
( x − 1 x − 2 x − 3 x + 1 ) (
) (x−1x−2x−3x+1)x−1x−2x−3x+1
求矩阵
A
=
(
1
2
2
a
)
A =
代码:
syms a;
A = [1 2;2 a];
iA = inv(A)
e = eig(A)
答:
该矩阵的逆(iA)为 ( a a − 4 − 2 a − 4 2 a − 4 1 a − 4 ) (
) (a−4aa−42−a−42a−41),aa−42a−4−2a−41a−4
特征值(e)为 ( a 2 − a 2 − 2 a + 17 2 + 1 2 a 2 + a 2 − 2 a + 17 2 + 1 2 ) () (2a−2a2−2a+17 +21 2a+2a2−2a+17 +21)。a2−a2−2a+17√2+12 a2+a2−2a+17√2+12
计算极限
lim x → ∞ ( 3 x + 9 x ) 1 x , lim y → 0 + lim x → 0 + ln ( 2 x + e − y ) x 3 + y 2 , lim x → ∞ ln ( 1 + 1 x ) a r c c o t x , lim x → 0 1 − 1 − x 2 e x − cos x \lim_{x \rightarrow \infty}\left( 3^{x} + 9^{x} \right)^{\frac{1}{x}},\lim_{y \rightarrow 0^{+}}{\lim_{x \rightarrow 0^{+}}\frac{\ln{(2x + e^{- y})}}{\sqrt{x^{3} + y^{2}}}},\\ \lim_{x \rightarrow \infty}\frac{\ln{(1 + \frac{1}{x})}}{arccot \, x},\lim_{x \rightarrow 0}\frac{1 - \sqrt{1 - x^{2}}}{e^{x} - \cos x} x→∞lim(3x+9x)x1,y→0+limx→0+limx3+y2 ln(2x+e−y),x→∞limarccotxln(1+x1),x→0limex−cosx1−1−x2
代码:
syms x y;
ans1 = limit((3^x+9^x)^(1/x),x,inf)
temp1 = limit(log(2*x+exp(-y))/(sqrt(x^3+y^2)-1),x,0);
ans2 = limit(s1,y,0)
ans3 = limit(log(1+1/x)/acot(x),x,inf)
ans4 = limit((1-sqrt(1-x^2))/(exp(x)-cos(x)),x,inf)
输出:
ans1 = 9
ans2 = 0
ans3 = 1
ans4 = 0
计算
∑ k = 1 n k 2 , ∑ k = 1 ∞ 1 k 2 , ∑ n = 0 ∞ 1 ( 2 n + 1 ) ( 2 x + 1 ) 2 n + 1 . \sum_{k = 1}^{n}k^{2},\ \sum_{k = 1}^{\infty}\frac{1}{k^{2}},\ \sum_{n = 0}^{\infty}\frac{1}{(2n + 1)(2x + 1)^{2n + 1}}. k=1∑nk2, k=1∑∞k21, n=0∑∞(2n+1)(2x+1)2n+11.
代码:
syms k n x;
s1=symsum(k^2,k,1,n);
s2=symsum(k^(-2),k,1,inf);
s3=symsum(1/(2*n+1)/(2*x+1)^(2*n+1),n,0,inf);
s1=simplify(s1)
s2=simplify(s2)
s3=simplify(s3)
输出:
s1 = n ( 2 n + 1 ) ( n + 1 ) 6 \frac{n\,(2\, n + 1)\,(n + 1)}{6} 6n(2n+1)(n+1)
s2 = π 2 6 \frac{\pi^{2}}{6} 6π2
s3 = a t a n h ( 1 2 x + 1 ) if 1 < ∥ 2 x + 1 ∥ atanh(\frac{1}{2x + 1}) \text{ if }1 < \|2x + 1\| atanh(2x+11) if 1<∥2x+1∥
求 ∂ 3 ∂ x 2 ∂ y sin ( x 2 y z ) ∥ x = 1 , y = 1 , z = 3 \left. \ \frac{\partial^{3}}{\partial x^{2}\partial y}\sin\left( x^{2}y z \right) \right\|_{x = 1,y = 1,z = 3} ∂x2∂y∂3sin(x2yz) x=1,y=1,z=3.
代码:
syms x y z;
s=sin(x^2*y*z);
s=diff(s,x,2);
s=diff(s,y,1);
s=subs(s,{x,y,z},{1,1,3})
输出:
s = l o g ( x + x 2 + 1 ) log(x + \sqrt{x^{2} + 1}) log(x+x2+1 )
(Taylor展开)求下列函数在 x = 0 x = 0 x=0的Taylor幂级数展开式(n=8):
e x , ln ( 1 + x ) , sin x , e^{x}, \ln{(1 + x)}, \sin x, ex,ln(1+x),sinx,
ln ( x + 1 + x 2 ) , 1 x 2 − 3 x + 2 . \ln{(x + \sqrt{1 + x^{2}})}, \frac{1}{x^{2} - 3x + 2}. ln(x+1+x2 ),x2−3x+21.
输出:
syms x
f1 = exp(x);
f2 = log(1+x);
f3 = sin(x);
f4 = log(x+sqrt(1+x^2));
f5 = 1/(x^2-3*x+2);
f = [f1 f2 f3 f4 f5];
for i=1:length(f)
taylor(f(i), x, 'Order', 9, 'ExpansionPoint', 0)
end
输出:
ans =
x 8 40320 + x 7 5040 + x 6 720 + x 5 120 + x 4 24 + x 3 6 + x 2 2 + x + 1 \frac{x^{8}}{40320} + \frac{x^{7}}{5040} + \frac{x^{6}}{720} + \frac{x^{5}}{120} + \frac{x^{4}}{24} + \frac{x^{3}}{6} + \frac{x^{2}}{2} + x + 1 40320x8+5040x7+720x6+120x5+24x4+6x3+2x2+x+1ans =
− x 8 8 + x 7 7 − x 6 6 + x 5 5 − x 4 4 + x 3 3 − x 2 2 + x - \frac{x^{8}}{8} + \frac{x^{7}}{7} - \frac{x^{6}}{6} + \frac{x^{5}}{5} - \frac{x^{4}}{4} + \frac{x^{3}}{3} - \frac{x^{2}}{2} + x −8x8+7x7−6x6+5x5−4x4+3x3−2x2+xans = − x 7 5040 + x 5 120 − x 3 6 + x - \frac{x^{7}}{5040} + \frac{x^{5}}{120} - \frac{x^{3}}{6} + x −5040x7+120x5−6x3+x
ans =
− 5 x 7 112 + 3 x 5 40 − x 3 6 + x - \frac{5\, x^{7}}{112} + \frac{3\, x^{5}}{40} - \frac{x^{3}}{6} + x −1125x7+403x5−6x3+xans =
511 x 8 512 + 255 x 7 256 + 127 x 6 128 + 63 x 5 64 + 31 x 4 32 + 15 x 3 16 + 7 x 2 8 + 3 x 4 + 1 2 \frac{511\, x^{8}}{512} + \frac{255\, x^{7}}{256} + \frac{127\, x^{6}}{128} + \frac{63\, x^{5}}{64} + \frac{31\, x^{4}}{32} + \frac{15\, x^{3}}{16} + \frac{7\, x^{2}}{8} + \frac{3\, x}{4} + \frac{1}{2} 512511x8+256255x7+128127x6+6463x5+3231x4+1615x3+87x2+43x+21
计算下列不定积分并用diff验证:
∫ e 2 x ( tan x + 1 ) 2 d x , ∫ e 2 y e y + 2 d y , ∫ x 2 a 2 − x 2 d x , \int e^{2x}(\tan x+1)^2dx,\int\frac{e^{2y}}{e^y+2}dy,\:\int\frac{x^2}{\sqrt{a^2-x^2}}dx, ∫e2x(tanx+1)2dx,∫ey+2e2ydy,∫a2−x2 x2dx,
∫ e x − 2 d x , ∫ d x x ( ln x + a + ln x + b ) ( a ≠ b ) . \int e^{x^{-2}}dx,\:\int\frac{dx}{x(\sqrt{\ln x+a}+\sqrt{\ln x+b})}\:(a\neq b). ∫ex−2dx,∫x(lnx+a +lnx+b )dx(a=b).
代码:
function intf(f,symbol) fi = int(f,symbol) s = simplify(diff(fi)); if (f / s == 1) fprintf('经验证,运算结果正确。') end end % 7.1 syms x; f1 = exp(2*x)*(tan(x)+1)^2; intf(f1,x); % 7.2 syms y; f2 = exp(2*y)/(exp(y)+2); intf(f2,y) % 7.3 syms x a; f3 = x^2/sqrt(a^2-x^2); intf(f3,x) % 7.4 syms x; f4 = exp(x^(-2)); intf(f4,x) % 7.5 syms x; syms a b; assume(a ~= b); f5 = 1/x/(sqrt(log(x)+a)+sqrt(log(x)+b)); intf(f5,x)
输出:
fi = e 2 x tan ( x ) e^{2\, x}\,\tan(x) e2xtan(x)
经验证,运算结果正确。fi = e y − 2 log ( e y + 2 ) e^{y} - 2\,\log(e^{y} + 2) ey−2log(ey+2)
fi =
a 2 a t a n ( x a 2 − x 2 ) 2 − x a 2 − x 2 2 \frac{a^{2}\, atan(\frac{x}{\sqrt{a^{2} - x^{2}}})}{2} - \frac{x\,\sqrt{a^{2} - x^{2}}}{2} 2a2atan(a2−x2 x)−2xa2−x2 经验证,运算结果正确。
fi = x expint ( 3 2 , − 1 x 2 ) 2 \frac{x\,\text{expint}(\frac{3}{2}, - \frac{1}{x^{2}})}{2} 2xexpint(23,−x21)
fi =
a + log ( x ) ( 2 a 3 a − 3 b + 2 log ( x ) 3 a − 3 b ) − b + log ( x ) ( 2 b 3 a − 3 b + 2 log ( x ) 3 a − 3 b ) \sqrt{a + \log(x)}\,\left( \frac{2\, a}{3\, a - 3\, b} + \frac{2\,\log(x)}{3\, a - 3\, b} \right) - \sqrt{b + \log(x)}\,\left( \frac{2\, b}{3\, a - 3\, b} + \frac{2\,\log(x)}{3\, a - 3\, b} \right) a+log(x) (3a−3b2a+3a−3b2log(x))−b+log(x) (3a−3b2b+3a−3b2log(x))
计算积分 I ( x ) = ∫ − x x ( x − y ) 3 sin ( x + 2 y ) d y I(x) = \int_{- x}^{x}{(x - y)^{3}\sin{(x + 2y)}}dy I(x)=∫−xx(x−y)3sin(x+2y)dy.
代码:
syms x y;
f=(x-y)^3*sin(x+2*y);
Ix=simplify(int(f,y,-x,x))
输出:
Ix =
4 x 3 c o s ( x ) − 3 x 2 s i n ( x ) + 3 c o s ( x ) 2 s i n ( x ) 2 − 3 x c o s ( x ) 2 4\, x^{3}\, cos(x) - 3\, x^{2}\, sin(x) + \frac{3\,{cos(x)}^{2}\, sin(x)}{2} - \frac{3\, x\, cos(x)}{2} 4x3cos(x)−3x2sin(x)+23cos(x)2sin(x)−23xcos(x)
用solve和vpasolve求解:
(1) x 2 + x + 1 x^{2} + x + 1 x2+x+1;
(2) 3 x 5 − 4 x 3 + 2 x − 1 3x^{5} - 4x^{3} + 2x - 1 3x5−4x3+2x−1;
(3) 5 x 23 − 6 x 7 + 8 x 6 − 5 x 2 5x^{23} - 6x^{7} + 8x^{6} - 5x^{2} 5x23−6x7+8x6−5x2;
(4)
{
a
=
0.7
sin
a
+
0.2
cos
b
b
=
0.7
cos
a
−
0.2
sin
b
代码:
syms x; f1 = x^2+x+1; f2 = 3*x^5-4*x^3+2*x-1; f3 = 5*x^23-6*x^7+8*x^6-5*x^2; syms a b; f4_1 = a-0.7*sin(a)-0.2*cos(b); f4_2 = b-0.7*cos(a)+0.2*sin(b); ans1 = solve(f1) ans1_vpa = vpasolve(f1) ans2 = solve(f2) ans2_vpa = vpasolve(f2) ans3 = solve(f3) ans3_vpa = vpasolve(f3) ans4=solve(f4_1,f4_2); a = ans4.a, b = ans4.b ans4_vpa = vpasolve([f4_1,f4_2],[a,b]); a = ans4_vpa.a, b = ans4_vpa.b
输出:
ans1 =
- (3^(1/2)*1i)/2 - 1/2
(3^(1/2)*1i)/2 - 1/2
ans1_vpa =
- 0.5 - 0.86602540378443864676372317075294i
- 0.5 + 0.86602540378443864676372317075294i
ans2 =
1
root(z^4 + z^3 - z^2/3 - z/3 + 1/3, z, 1)
root(z^4 + z^3 - z^2/3 - z/3 + 1/3, z, 2)
root(z^4 + z^3 - z^2/3 - z/3 + 1/3, z, 3)
root(z^4 + z^3 - z^2/3 - z/3 + 1/3, z, 4)
ans2_vpa =
1.0
- 0.94789546187456058989982247394741 +
0.38447007122004299382156325898354i…
b =
0.50791971903684924497183722688768
用dsolve求解:
(1) y ′ = x + y , y ( 0 ) = 1 y^{'} = x + y,\ y(0) = 1 y′=x+y, y(0)=1
(2) − x ′ = 2 x + 3 y , y ′ = 2 x + y , x ( 0 ) = − 2.7 , y ( 0 ) = 2.8 - x^{'} = 2x + 3y,\ y^{'} = 2x + y,\ x(0) = - 2.7,\ y(0) = 2.8 −x′=2x+3y, y′=2x+y, x(0)=−2.7, y(0)=2.8
(3) y ′ ′ − 0.01 y ′ 2 + 2 y = sin t , y ( 0 ) = 1 , y ′ ( 0 ) = 0 y^{''} - 0.01y^{'2} + 2y = \sin t,\ y(0) = 1,\ y^{'}(0) = 0 y′′−0.01y′2+2y=sint, y(0)=1, y′(0)=0
(4) 2 x ′ ′ ( t ) − 5 x ′ ( t ) − 3 x ( t ) = 90 e 2 t , x ( 0 ) = 2 , x ′ ( 0 ) = 1 2x^{''}(t) - 5x^{'}(t) - 3x(t) = 90e^{2t},\ x(0) = 2,\ x^{'}(0) = 1 2x′′(t)−5x′(t)−3x(t)=90e2t, x(0)=2, x′(0)=1
(5) x ′ ′ = − 2 x ′ t + 2 x t 2 + 10 cos ln t t 2 , x ( 1 ) = 1 , x ( 3 ) = 3. x^{''} = - \frac{2x^{'}}{t} + \frac{2x}{t^{2}} + \frac{10\cos{\ln t}}{t^{2}},\ x(1) = 1,\ x(3) = 3. x′′=−t2x′+t22x+t210coslnt, x(1)=1, x(3)=3.
代码:
% 10.1 syms y(x) Dy = diff(y); eqn = Dy == x + y; cond = y(0) == 1; S = dsolve(eqn, cond) % 10.2 syms x(t) y(t) eqn1 = diff(x, t) == -2*x - 3*y; eqn2 = diff(y, t) == 2*x + y; eqns = [eqn1, eqn2]; cond1 = x(0) == -2.7; cond2 = y(0) == 2.8; conds = [cond1, cond2]; S = dsolve(eqns, conds); Sx = S.x, Sy = S.y % 10.3 (解不出) syms y(t) eqn = diff(y, t, t) - 0.01*(diff(y, t))^2 + 2*y == sin(t); cond1 = y(0) == 1; Dy = diff(y); cond2 = Dy(0) == 0; conds = [cond1, cond2]; S = dsolve(eqn, conds) % 10.4 syms x(t) eqn = 2*diff(x, t, t) - 5*diff(x, t) - 3*x == 90*exp(2*t); cond1 = x(0) == 2; Dx = diff(x); cond2 = Dx(0) == 1; conds = [cond1, cond2]; S = dsolve(eqn, conds) % 10.5 syms x(t) eqn = diff(x, t, t) == -(2*diff(x, t))/t + 2*x/t^2 + (10*cos(log(t)))/t^2; cond1 = x(1) == 1; cond2 = x(3) == 3; conds = [cond1, cond2]; S = dsolve(eqn, conds)
输出:
S = 2 e x − x − 1 2\, e^{x} - x - 1 2ex−x−1
Sx =
4 15 ( 3 e − t 2 σ 1 4 − 15 e − t 2 σ 2 4 ) 25 − 21 e − t 2 σ 2 10 − 7 15 e − t 2 σ 1 10 w h e r e σ 1 = sin ( 15 t 2 ) σ 2 = cos ( 15 t 2 )
25415 (43e−2tσ1−415 e−2tσ2)−1021e−2tσ2−10715 e−2tσ1where σ1=sin(215 t) σ2=cos(215 t)415√⎛⎝⎜3e−t2σ14−15√e−t2σ24⎞⎠⎟25−21e−t2σ210−715√e−t2σ110where σ1=sin(15√t2) σ2=cos(15√t2) Sy =
14 e − t 2 cos ( 15 t 2 ) 5 − 4 15 e − t 2 sin ( 15 t 2 ) 25 \frac{14\, e^{- \frac{t}{2}}\,\cos(\frac{\sqrt{15}\, t}{2})}{5} - \frac{4\,\sqrt{15}\, e^{- \frac{t}{2}}\,\sin(\frac{\sqrt{15}\, t}{2})}{25} 514e−2tcos(215 t)−25415 e−2tsin(215 t)警告: Unable to find symbolic solution.
S = [ empty sym ]
S =
2 e − t 2 ( 47 e 7 t 2 − 63 e 5 t 2 + 23 ) 7 \frac{2\, e^{- \frac{t}{2}}\,\left( 47\, e^{\frac{7\, t}{2}} - 63\, e^{\frac{5\, t}{2}} + 23 \right)}{7} 72e−2t(47e27t−63e25t+23)S = t 3 ( 27 10 σ 1 26 + 69 26 ) 3 − 10 t 2 cos ( a t a n ( 1 3 ) + log ( t ) ) t 2 − 9 10 σ 1 26 − 81 26 t 2 w h e r e σ 1 = cos ( a t a n ( 1 3 ) + log ( 3 ) )
t23t3(262710 σ1+2669)−10 t2cos(atan(31)+log(t))−t226910 σ1−2681where σ1=cos(atan(31)+log(3))t3(2710√σ126+6926)3−10√t2cos(atan(13)+log(t))t2−910√σ126−8126t2where σ1=cos(atan(13)+log(3))
计算导数:
y
=
1
+
sin
x
1
−
cos
x
y = \frac{1 + \sin x}{1 - \cos x}
y=1−cosx1+sinx,
y
=
[
arcsin
x
arccos
x
arctan
x
a
r
c
c
o
t
x
]
y =
代码:
% 对于函数 y = (1 + sin(x))/(1 - cos(x))
syms x;
y1 = (1 + sin(x))/(1 - cos(x));
y_prime_1 = diff(y1, x)
% 对于向量函数 y = [arcsin(x), arccos(x), arctan(x), arccot(x)]
y2 = [asin(x), acos(x); atan(x), acot(x)];
y_prime_2 = diff(y2, x)
输出:
y_prime_1 = − cos ( x ) cos ( x ) − 1 − sin ( x ) ( sin ( x ) + 1 ) ( cos ( x ) − 1 ) 2 - \frac{\cos(x)}{\cos(x) - 1} - \frac{\sin(x)\,\left( \sin(x) + 1 \right)}{\left( \cos(x) - 1 \right)^{2}} −cos(x)−1cos(x)−(cos(x)−1)2sin(x)(sin(x)+1)
y_prime_2 = ( 1 1 − x 2 − 1 1 − x 2 1 x 2 + 1 − 1 x 2 + 1 ) (
) (1−x2 1x2+11−1−x2 1−x2+11)11−x2√1x2+1−11−x2√−1x2+1
计算下列定积分:
∫ 0 π 4 x 1 + cos 2 x d x , ∫ 0 1 x ( 1 − x 4 ) 3 2 d x \int_{0}^{\frac{\pi}{4}}\frac{x}{1 + \cos{2x}}dx,\ \int_{0}^{1}{x\left( 1 - x^{4} \right)^{\frac{3}{2}}}dx ∫04π1+cos2xxdx, ∫01x(1−x4)23dx
代码:
syms x;
f1 = x / (1 + cos(2*x));
int(f1, 0, pi/4)
f2 = x * (1 - x^4)^(3/2);
int(f2, 0, 1)
输出:
ans = π 8 − log ( 2 ) 4 \frac{\pi}{8} - \frac{\log(2)}{4} 8π−4log(2)
ans = 3 π 32 \frac{3\,\pi}{32} 323π
求点赞。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。