我正在尝试一个可以用MUC(未定系数法)解决的问题。
但是,当我使用 Solve 函数时,出现错误。
y[x_] := a x^3 + b x^2 + c x + d
Solve[{y''[x] + 2 y'[x] + y[x] == x^3}, {a, b, c, d}]
[ERROR]:
Solve::svars: Equations may not give solutions for all "solve" variables.
这不应该解决集合中的所有变量吗?
感谢您的帮助:)
最佳答案
看起来像some extra methodology为此需要。
正如您所说,具有 x^3
的有限导数族的函数是
y[x_] := a x^3 + b x^2 + c x + d
使系数相等
sol = Solve[Thread[CoefficientList[
y''[x] + 2 y'[x] + y[x], x] == CoefficientList[x^3, x]]]
{{a -> 1, b -> -6, c -> 18, d -> -24}}
检查结果
FullSimplify[y''[x] + 2 y'[x] + y[x] == x^3 /. sol]
{True}
关于wolfram-mathematica - 如何修复 'Equations may not give solutions for all "解决“变量”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55990153/