-2
$\begingroup$

The ODE in question: y'' + 3y' + 2y = 8t + 8

But I get something like this for my solution:

enter image description here

I also tried getting the solution of y'=y^2-y^3 but again the solution did not make sense to me.

$\endgroup$
6
  • $\begingroup$ You should use == instead of = to define the equations! $\endgroup$ Commented Aug 13, 2020 at 10:02
  • $\begingroup$ In my question I might have used '=' but in mathematica I definitely used == everywhere. So I don't think that's the issue with getting the solution. $\endgroup$
    – Kurapika
    Commented Aug 13, 2020 at 10:05
  • $\begingroup$ It would be very helpful if you provide your code! See my answer. $\endgroup$ Commented Aug 13, 2020 at 10:06
  • 1
    $\begingroup$ It seems as if y is already defined. ClearAll[y] might do the trick. This is a general advice: If something doesn't work, restart the kernel. $\endgroup$
    – Natas
    Commented Aug 13, 2020 at 10:08
  • $\begingroup$ Is my code not visible? I attached a screenshot of my workout. It is the standard way to solve ODE on mathematica but it did not work in my case. $\endgroup$
    – Kurapika
    Commented Aug 13, 2020 at 10:09

2 Answers 2

2
$\begingroup$

You should use == instead of = to define the equations:

DSolve[y''[t] + 3 y'[t] + 2 y[t] == 8 t + 8, y, t]
(*{{y -> Function[{t}, 2 (-1 + 2 t) + E^(-2 t) C[1] + E^-t C[2]]}}*)
$\endgroup$
4
  • $\begingroup$ I did exactly this and I get that huge bizarre solution I showed in my question's picture. $\endgroup$
    – Kurapika
    Commented Aug 13, 2020 at 10:13
  • 1
    $\begingroup$ Restart Mathematica and it 'll work find. The dump of your code shows that the unknown function y[t] is already defined! $\endgroup$ Commented Aug 13, 2020 at 10:52
  • $\begingroup$ yeah restarted mathematica after waiting for a while, it worked. Also, aren't we supposed to write- y[t],t towards the end? Also, would normal plotting methods suffice for this differential equation? $\endgroup$
    – Kurapika
    Commented Aug 13, 2020 at 14:26
  • $\begingroup$ Feel free to use notation ...,y[t],t] The form I used has several advantages (see the documentation) because DSolve[…,y,t] returns a pure function: "With a pure function output, eqn/. {y->...} can be used to verify the solution" $\endgroup$ Commented Aug 13, 2020 at 14:57
-2
$\begingroup$

"The ODE in question: y'' + 3y' + 2y = 8t + 8"

is a linear inhomogeneous ordinary differential equation with real constant coefficients. The inhomogeneity is a linear polynomial with constant real coefficients.

Solution:

DSolve[y''[t] + 3 y'[t] + 2 y[t] == 8 t + 8, y, t]
(*{{y -> Function[{t}, 2 (-1 + 2 t) + E^(-2 t) C[1] + E^-t C[2]]}}*)

using DSolve.

The corresponding mathematical understanding is: a) solve the homogeneous equation.

DSolve[y''[t] + 3 y'[t] + 2 y[t] == 0, y, t]

{{y -> Function[{t}, E^(-2 t) C[1] + E^-t C[2]]}}

b) solve the corresponding inhomogeneous equation by variation of constants. That is already done using DSolve. In proper mathematical work, this would be setting the coefficient functions dependent on t and differentiate and then match the coefficients.

To complete degrees of freedom in constants of the solution is that of the order of the linear inhomogeneous ordinary differential equation with real constant coefficients. That is two regarding to the second-order of the linear inhomogeneous ordinary differential equation with real constant coefficients.

The varied coefficient functions are completely defined by the inhomogeneity.

There are different formalisms available to solve that in mathematics.

Probe:

D[2 (-1 + 2 t) + E^(-2 t) C[1] + E^-t C[2], t, t] + 
 3 D[2 (-1 + 2 t) + E^(-2 t) C[1] + E^-t C[2], t] + 
 2 (2 (-1 + 2 t) + E^(-2 t) C[1] + E^-t C[2])

4 E^(-2 t) C[1] + E^-t C[2] + 3 (4 - 2 E^(-2 t) C[1] - E^-t C[2]) + 2 (2 (-1 + 2 t) + E^(-2 t) C[1] + E^-t C[2])


% // FullSimplify


8 (1 + t)

So the solution from DSolve solves really the linear inhomogeneous ordinary differential equation with real constant coefficients.

  1. part of the question

    DSolve[y'[t] == y[t]^2 - y[t]^3, y, t]


{{y -> Function[{t}, 
    InverseFunction[Log[1 - #1] - Log[#1] + 1/#1 &][-t + C[1]]]}}

This is a homogeneous nonlinear ordinary differential equation polynomial in the differentiated function and of order one. The ODE is separable and has therefore an exact solution.

y'==dy/dt==y^2-y^3

separates into

dt=dy/(y^2-y^3)

t-t0==Integrate[1/(y^2-y^3),y]

t-t0==-(1/y) - Log[1 - y] + Log[y]

As shown be DSolve there is not closed inverse function.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.