Dsolve answer different than expected answer.

I was tasked with using dsolve to get the answer for the first order linear differential equation y' + 6y = 3e^-2t. this is the code that I am using syms y(t)
eqn = diff(y,t) + 6*y == (3*exp(-2*t));
cond = y(0) == 2;
ySol(t) = dsolve(eqn,cond)
the answer given is (exp(-6*t)*(3*exp(4*t) + 5))/4
and I expected to get and answer equivalent to 3/4e^-2t + 5/4e^-6t
not sure where my error here lies.
Thank you in advance.

2 件のコメント

Torsten
Torsten 2022 年 3 月 26 日
編集済み: Torsten 2022 年 3 月 26 日
The two expressions are equal.
Maybe a "simplify" on the result will give your solution.
Thomas Kurupas
Thomas Kurupas 2022 年 3 月 26 日
Oh my goodness I see it now. Thank you so much I somehow missed that exp(-6*t) is multiplied by 5 making them equivalent.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeNumerical Integration and Differential Equations についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 3 月 26 日

コメント済み:

2022 年 3 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by