What are you trying to do with the lines:
Which have nothing to do with the problem?
It looks like they are trash, left over from your last assignment.
Anyway, using dsolve does not seem to be the correct idea for this.
What do we know? That you want to solve the problem
y' ' + 3*y' - 2*y = 0
subject to the information that y(t) = a*t^4 + b*t^3 + c*t^2 + d*t + e
The initial conditions are simple to implement. y(0) = 4 implies that e is trivially 4.
y'(0) = 7 likewise implies that d is 7.
However, you have provided only one other piece of information, that the differential equation applies. This is ONE piece of information, and you have 3 unknown coefficients to learn, thus a,b,c.
syms t a b c
y(t) = a*t^4 + b*t^3 + c*t^2 + 7*t + 4;
eqn = diff(y,t,2) + 3*diff(y,t,1) - 2*y
2*c - 14*t + 6*b*t + 6*c*t + 12*a*t^2 + 12*a*t^3 - 2*a*t^4 + 9*b*t^2 - 2*b*t^3 - 2*c*t^2 + 13
And that last result needs to be identically zero for all t to satisfy the differential equation. But that cannot be true for more than 3 values of t.
So you cannot solve the problem exactly. We should have known that in advance anyway, because the polynomial you provide is not a solution to that differential equation, which would generally involve exponentials.
As such, I think the best you can do is to find some sort of best approximation, that would apply over some specified interval.
Here is the next problem, since no interval was indicated for the solution. If I pick, for example, the interval [0,1] to solve it over, then we might do this:
inteqn = int(eqn.^2,t,[0,1])
(26762*a^2)/315 + 121*a*b + (2476*a*c)/35 + (446*a)/15 + (1574*b^2)/35 + (169*b*c)/3 + (176*b)/5 + (302*c^2)/15 + (128*c)/3 + 157/3
Thus, integrate the square of the result. If that integral is identically zero, then you have found a solution to the differential equation.
So any real valued set of the parameters a,b,c that satisfies that one relation will solve your problem. However, I think it is true that no real valued set of the parameters a,b,c exist that satisfy that relation. (Claim made without a lot of thought invested.) So then at best you would need to choose a value of a,b,c that minimizes that relation.
abcfun = matlabFunction(inteqn);
abc = fminsearch(@(abc) abcfun(abc(1),abc(2),abc(3)),[1 1 1])
-1.59279872440389 5.35213580681714 -5.74895967322016
fminsearch was not indeed able to find a solution that reduces the result to zero. However, the set of parameters we have found is one that minimizes the error of the polynomial approximation to the ODE posed, while still satisfying the initial conditions exactly.
title 'Best approximate solution to the ODE'
Does it satisfy the ODE? Well, no.
yhat = subs(y,[a,b,c],abc);
fplot(diff(yhat,t,2) + 3*diff(yhat,t,1) - 2*yhat,[0,1])
ylabel 'Error of the ODE'
But the integral of the squared error over that interval is as small as I could make it.
Is this what was intended by the original question? I have no idea, because the question is posed pretty vaguely.