Keep getting the wrong answer in this lengthy Laplace problem

Click For Summary
SUMMARY

The forum discussion centers on solving the differential equation y'' + 4y = 8t^2 for 0 < t < 5 using the Laplace transform, with initial conditions y(1) = 1 + cos(2) and y'(1) = 4 - 2sin(2). The original attempt at the solution involved incorrect application of the unit step function, leading to confusion in the transformation process. Participants clarified that the correct formulation should express the function in terms of step functions and emphasized the need for careful application of the Laplace transform, particularly in handling initial conditions and partial fraction decomposition.

PREREQUISITES
  • Understanding of Laplace transforms and their properties
  • Familiarity with differential equations, specifically second-order linear equations
  • Knowledge of unit step functions and their applications in piecewise functions
  • Experience with partial fraction decomposition in the context of Laplace transforms
NEXT STEPS
  • Review the application of the Laplace transform on piecewise functions
  • Study the method of partial fraction decomposition for complex rational functions
  • Practice solving second-order differential equations with varying initial conditions
  • Explore alternative methods for solving differential equations, such as the method of undetermined coefficients
USEFUL FOR

Students and educators in engineering and mathematics, particularly those focusing on differential equations and Laplace transforms, as well as anyone seeking to improve their problem-solving skills in this area.

Jonas E
Messages
15
Reaction score
0

Homework Statement


y'' + 4y = 8t^2 if 0 < t < 5, and 0 if t > 5; y(1) = 1 + cos(2), y'(1) = 4 - 2sin(2). Use the Laplace transform to find y.

Homework Equations


t-shift, s-shift, unit step function.

The Attempt at a Solution


I have been trying to solve it for hours, but keep getting the wrong solution. Each solution takes about 40 minutes, and I'm wondering if there is a faster way than my method, which is:

y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

i set t = T + 1,

ỹ'' + 4ỹ = 8(T + 1)^2 - 8(T + 1)^2 * u(T - 4)

Then I use Laplace on both sides, and get some very messy expressions. I solve for Ỹ = ℒ(ỹ) on the left. I reduce everything on the right with partial fractions., which takes an insane amount of time. Then i find ỹ by taking the inverse Laplace on both sides. Finally, I substitute T with r - 1. Is this the correct way of doing it?
 
Physics news on Phys.org
This first step is wrong:

Jonas E said:
y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

In order to write ##f(t)## in terms of step functions, you need to write:

$$f(t) = 8t^2 [u(t - 0) - u(t - 5)] = 8t^2 u(t - 0) - 8t^2 u(t - 5)$$

Now obtain ##Y(s)## by applying the Laplace transform to both sides and continue.
 
Zondrina said:
This first step is wrong:

Jonas E said:
y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

Zondrina said:
In order to write ##f(t)## in terms of step functions, you need to write:

$$f(t) = 8t^2 [u(t - 0) - u(t - 5)] = 8t^2 u(t - 0) - 8t^2 u(t - 5)$$
But isn't u(t - 0) = 1 for t ≥ 0? How is what you wrote correct and what the OP wrote incorrect if both are the same.
Zondrina said:
Now obtain ##Y(s)## by applying the Laplace transform to both sides and continue.
It's possible that you (@Zondrina) didn't read the OP closely enough. What Jonas is trying to do is to use a translated coordinate system to get the initial conditions at 0 instead of 1.

Jonas, show us what you get when you take the Laplace transform of the last equation you show. What you describe as your process seems fine to me, except for the last step -- replace T by t - 1, not r - 1.

This DE happens to be easier to solve using other methods than by Laplace transforms. As a check on your work, you might go at it using another method, if you know another. Both methods should give the same solution.
 
  • Like
Likes   Reactions: Jonas E
Jonas E said:

Homework Statement


y'' + 4y = 8t^2 if 0 < t < 5, and 0 if t > 5; y(1) = 1 + cos(2), y'(1) = 4 - 2sin(2). Use the Laplace transform to find y.

Homework Equations


t-shift, s-shift, unit step function.

The Attempt at a Solution


I have been trying to solve it for hours, but keep getting the wrong solution. Each solution takes about 40 minutes, and I'm wondering if there is a faster way than my method, which is:

y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

i set t = T + 1,

ỹ'' + 4ỹ = 8(T + 1)^2 - 8(T + 1)^2 * u(T - 4)

Then I use Laplace on both sides, and get some very messy expressions. I solve for Ỹ = ℒ(ỹ) on the left. I reduce everything on the right with partial fractions., which takes an insane amount of time. Then i find ỹ by taking the inverse Laplace on both sides. Finally, I substitute T with r - 1. Is this the correct way of doing it?

Yes, provided that you did the steps correctly, which we cannot judge because you do not present the details. What is your final expression for ##y(t)##? I might be able to compare your final expression with mine.
 
  • Like
Likes   Reactions: Jonas E
Sorry, @Mark44 , I meant T by t - 1, not r - 1.

Here are the steps I did:

y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

ỹ'' + 4ỹ = 8(T + 1)^2 - 8(T + 1)^2 * u(T - 4)

ỹ'' + 4ỹ = 8(T^2 + 2T + 1) - 8(T^2 + 2T + 1) * u(t - 4)

I use Laplace on both sides and get:

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = 16/s^3 + 16/s^2 + 8/s - 8ℒ(T^2 * u(t - 4)) - 16ℒ(T * u(t - 4)) - 8ℒ(u(t - 4))

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = 16/s^3 + 16/s^2 + 8/s - 8e^(-4s) * (2/s^3 + 8/s^2 + 16/s) - 16e^(-4s) * (1/s^2 + 4/s) - 8e^(-4s) * 1/s

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = (16 + 16s + 8s^2) / (s^3) - e^(-4s) * (16 - 80s - 200s^2) / (s^3)

Then I solve for Ỹ on the left, and get:

Ỹ = (16 + 16s + 8s^2) / [(s^4)(s+4)] - e^(-4s) * (16 - 80s - 200s^2) / [(s^4)(s+4)] + (s + scos(2) - 2sin(2) + 8 + 4cos(2)) / [s(s+4)]

Now I use partial fraction decomposition on all 3 terms:

first term) (16 + 16s + 8s^2) / [(s^4)(s+4)] = (As^3 + Bs^2 + Cs + D) / (s^4) + E / (s + 4)

I get A = -5 / 16, B = 5 / 4, C = 3, D = 4, E = 5 / 16second term) (16 - 80s - 200s^2) / [(s^4)(s+4)] = (As^3 + Bs^2 + Cs + D) / (s^4) + E / (s + 4)

I get A = -179 / 16, B = 179 / 4, C = 21, D = -4, E = 179 / 16third term) (s + scos(2) - 2sin(2) + 8 + 4cos(2)) / [s(s+4)] = A / s + B / (s + 4)

I get A = 2 - (1/2)sin(2) + cos(2), B = (1/2)sin(2) - 1Now I put it all together:

Ỹ = (-5 / 16s) + (5 / 4s^2) + (3 / s^3) + (4 / s^4) + (5 / 16(s+4)) + e^(-4s) * [(-179 / 16s) + (179 / 4s^2) + (21 / s^3) + (-4 / s^4) + (179 / 16(s+4))]
+ [2 - (1/2)sin(2) + cos(2)] / s + [(1/2)sin(2) - 1] / (s + 4)

(At this point I think I have already made a mistake somewhere, because it looks too messy to be correct)
Now I use inverse Laplace on both sides and get:

ỹ = (- 5 / 16) + (5/4)T + (3/2)T^2 + (2/3)T^3 + (5/16)e^(-4T) - (179/16)u(T - 4) + (179/4)(T-4)u(T - 4) + (21/2)(T-4)^2 * u(T - 4) - (2/3)(T-4)^3 * u(T - 4)
+ (179/16)e^(-4T + 16) * u(T-4) + [2 - (1/2)sin(2) + cos(2)] + [(1/2)sin(2) - 1]e^(-4T)

Now I simplify, and substitute T with t - 1, and get:

y = -5/16 + (5/4)(t-1) + (3/2)(t^2 -2t + 1) + (2/3)(t^3 -3t^2 +3t -1) + (5/16)e^(-4t+4) + 2 - (1/2)sin(2) + cos(2) + (1/2)sin(2)e^(-4t+4) - e(-4t+4) + (179e^20 / 16)e^(-4t)
+ [5323/48 - (441/4)t \ (41/2)t^2 - (2/3)t^3]u(t-5)

Thanks a lot for the feedback.

P.S.
The final expression, according to Kreyszig's "Advanced Engineering Mathematics, 9th edition", should be:

cos(2t) + 2t^2 - 1, if 0 < t < 5

cos(2t) + 49cos(2t - 10 + 10sin(2t - 10), if t > 5
 
Jonas E said:
Sorry, @Mark44 , I meant T by t - 1, not r - 1.

Here are the steps I did:

y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

ỹ'' + 4ỹ = 8(T + 1)^2 - 8(T + 1)^2 * u(T - 4)

ỹ'' + 4ỹ = 8(T^2 + 2T + 1) - 8(T^2 + 2T + 1) * u(t - 4)

I use Laplace on both sides and get:

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = 16/s^3 + 16/s^2 + 8/s - 8ℒ(T^2 * u(t - 4)) - 16ℒ(T * u(t - 4)) - 8ℒ(u(t - 4))
I believe that your mistake is in the line above. The transformation you did, T = t - 1, is in the t domain, not in the s domain. Taking the Laplace transform of the diff. equation a few lines up should give you this:
##s^2Ỹ - s + \text{ rest of the stuff}##.

I agree that this is a very messy problem, made much more difficult by the initial conditions.

Since problems like this have so many steps, I've found that it's a good idea to check all steps that I can. For example, after doing a step with partial fractions, verify that my decomposition actually gets me back to what I started with.
Jonas E said:
s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = 16/s^3 + 16/s^2 + 8/s - 8e^(-4s) * (2/s^3 + 8/s^2 + 16/s) - 16e^(-4s) * (1/s^2 + 4/s) - 8e^(-4s) * 1/s

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = (16 + 16s + 8s^2) / (s^3) - e^(-4s) * (16 - 80s - 200s^2) / (s^3)

Then I solve for Ỹ on the left, and get:

Ỹ = (16 + 16s + 8s^2) / [(s^4)(s+4)] - e^(-4s) * (16 - 80s - 200s^2) / [(s^4)(s+4)] + (s + scos(2) - 2sin(2) + 8 + 4cos(2)) / [s(s+4)]

Now I use partial fraction decomposition on all 3 terms:

first term) (16 + 16s + 8s^2) / [(s^4)(s+4)] = (As^3 + Bs^2 + Cs + D) / (s^4) + E / (s + 4)

I get A = -5 / 16, B = 5 / 4, C = 3, D = 4, E = 5 / 16second term) (16 - 80s - 200s^2) / [(s^4)(s+4)] = (As^3 + Bs^2 + Cs + D) / (s^4) + E / (s + 4)

I get A = -179 / 16, B = 179 / 4, C = 21, D = -4, E = 179 / 16third term) (s + scos(2) - 2sin(2) + 8 + 4cos(2)) / [s(s+4)] = A / s + B / (s + 4)

I get A = 2 - (1/2)sin(2) + cos(2), B = (1/2)sin(2) - 1Now I put it all together:

Ỹ = (-5 / 16s) + (5 / 4s^2) + (3 / s^3) + (4 / s^4) + (5 / 16(s+4)) + e^(-4s) * [(-179 / 16s) + (179 / 4s^2) + (21 / s^3) + (-4 / s^4) + (179 / 16(s+4))]
+ [2 - (1/2)sin(2) + cos(2)] / s + [(1/2)sin(2) - 1] / (s + 4)

(At this point I think I have already made a mistake somewhere, because it looks too messy to be correct)
Now I use inverse Laplace on both sides and get:

ỹ = (- 5 / 16) + (5/4)T + (3/2)T^2 + (2/3)T^3 + (5/16)e^(-4T) - (179/16)u(T - 4) + (179/4)(T-4)u(T - 4) + (21/2)(T-4)^2 * u(T - 4) - (2/3)(T-4)^3 * u(T - 4)
+ (179/16)e^(-4T + 16) * u(T-4) + [2 - (1/2)sin(2) + cos(2)] + [(1/2)sin(2) - 1]e^(-4T)

Now I simplify, and substitute T with t - 1, and get:

y = -5/16 + (5/4)(t-1) + (3/2)(t^2 -2t + 1) + (2/3)(t^3 -3t^2 +3t -1) + (5/16)e^(-4t+4) + 2 - (1/2)sin(2) + cos(2) + (1/2)sin(2)e^(-4t+4) - e(-4t+4) + (179e^20 / 16)e^(-4t)
+ [5323/48 - (441/4)t \ (41/2)t^2 - (2/3)t^3]u(t-5)

Thanks a lot for the feedback.

P.S.
The final expression, according to Kreyszig's "Advanced Engineering Mathematics, 9th edition", should be:

cos(2t) + 2t^2 - 1, if 0 < t < 5

cos(2t) + 49cos(2t - 10 + 10sin(2t - 10), if t > 5
 
  • Like
Likes   Reactions: Jonas E
Ah, thanks a lot for the help. So, the mistake was that s(s + 4)Ỹ should have been (s^2 + 4)Ỹ instead? It seems I accidentally calculated 4ℒ(ỹ) to be 4sỸ
 
Jonas E said:
Ah, thanks a lot for the help. So, the mistake was that s(s + 4)Ỹ should have been (s^2 + 4)Ỹ instead? It seems I accidentally calculated 4ℒ(ỹ) to be 4sỸ
Yes, I believe so.
You had ##\bar{y"} + 4\bar{y}## on the left side. After the transform, this would be ##s^2Y(s) - s\bar{y'}(0) - \bar{y}(0) + 4Y(s) = (s^2 + 4)Y(s) + \text{ other stuff}##.

You showed a lot of work, so it's possible there are other mistakes. What I noted was what caught my eye.
 
  • Like
Likes   Reactions: Jonas E
Jonas E said:
Sorry, @Mark44 , I meant T by t - 1, not r - 1.

Here are the steps I did:

y'' + 4y = 8t^2 * [1 - u(t-5)] = 8t^2 - 8t^2 * u(t-5)

ỹ'' + 4ỹ = 8(T + 1)^2 - 8(T + 1)^2 * u(T - 4)

ỹ'' + 4ỹ = 8(T^2 + 2T + 1) - 8(T^2 + 2T + 1) * u(t - 4)

I use Laplace on both sides and get:

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = 16/s^3 + 16/s^2 + 8/s - 8ℒ(T^2 * u(t - 4)) - 16ℒ(T * u(t - 4)) - 8ℒ(u(t - 4))

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = 16/s^3 + 16/s^2 + 8/s - 8e^(-4s) * (2/s^3 + 8/s^2 + 16/s) - 16e^(-4s) * (1/s^2 + 4/s) - 8e^(-4s) * 1/s

s(s + 4)Ỹ - s - scos(2) + 2sin(2) - 8 - 4cos(2) = (16 + 16s + 8s^2) / (s^3) - e^(-4s) * (16 - 80s - 200s^2) / (s^3)

Then I solve for Ỹ on the left, and get:

Ỹ = (16 + 16s + 8s^2) / [(s^4)(s+4)] - e^(-4s) * (16 - 80s - 200s^2) / [(s^4)(s+4)] + (s + scos(2) - 2sin(2) + 8 + 4cos(2)) / [s(s+4)]

Now I use partial fraction decomposition on all 3 terms:

first term) (16 + 16s + 8s^2) / [(s^4)(s+4)] = (As^3 + Bs^2 + Cs + D) / (s^4) + E / (s + 4)

I get A = -5 / 16, B = 5 / 4, C = 3, D = 4, E = 5 / 16second term) (16 - 80s - 200s^2) / [(s^4)(s+4)] = (As^3 + Bs^2 + Cs + D) / (s^4) + E / (s + 4)

I get A = -179 / 16, B = 179 / 4, C = 21, D = -4, E = 179 / 16third term) (s + scos(2) - 2sin(2) + 8 + 4cos(2)) / [s(s+4)] = A / s + B / (s + 4)

I get A = 2 - (1/2)sin(2) + cos(2), B = (1/2)sin(2) - 1Now I put it all together:

Ỹ = (-5 / 16s) + (5 / 4s^2) + (3 / s^3) + (4 / s^4) + (5 / 16(s+4)) + e^(-4s) * [(-179 / 16s) + (179 / 4s^2) + (21 / s^3) + (-4 / s^4) + (179 / 16(s+4))]
+ [2 - (1/2)sin(2) + cos(2)] / s + [(1/2)sin(2) - 1] / (s + 4)

(At this point I think I have already made a mistake somewhere, because it looks too messy to be correct)
Now I use inverse Laplace on both sides and get:

ỹ = (- 5 / 16) + (5/4)T + (3/2)T^2 + (2/3)T^3 + (5/16)e^(-4T) - (179/16)u(T - 4) + (179/4)(T-4)u(T - 4) + (21/2)(T-4)^2 * u(T - 4) - (2/3)(T-4)^3 * u(T - 4)
+ (179/16)e^(-4T + 16) * u(T-4) + [2 - (1/2)sin(2) + cos(2)] + [(1/2)sin(2) - 1]e^(-4T)

Now I simplify, and substitute T with t - 1, and get:

y = -5/16 + (5/4)(t-1) + (3/2)(t^2 -2t + 1) + (2/3)(t^3 -3t^2 +3t -1) + (5/16)e^(-4t+4) + 2 - (1/2)sin(2) + cos(2) + (1/2)sin(2)e^(-4t+4) - e(-4t+4) + (179e^20 / 16)e^(-4t)
+ [5323/48 - (441/4)t \ (41/2)t^2 - (2/3)t^3]u(t-5)

Thanks a lot for the feedback.

P.S.
The final expression, according to Kreyszig's "Advanced Engineering Mathematics, 9th edition", should be:

cos(2t) + 2t^2 - 1, if 0 < t < 5

cos(2t) + 49cos(2t - 10 + 10sin(2t - 10), if t > 5

I think you made an error in your transformation of the LHS. I will use the notation ##z(T)## instead of ##y(T+1)##, so on the left you should have
{\cal L} ( z^{&#039;&#039;} + 4 z ) (s) = s[s Z_s - z(0)] - z&#039;(0) + 4 Z_s = (s^2 + 4) Z_s - s(1 + \cos(2)) - (4 - 2 \sin(2))
Here, ##Z_s = {\cal L} (z)(s)##.

The correct expression on the left is different from yours.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
975
  • · Replies 2 ·
Replies
2
Views
1K
Replies
9
Views
2K