Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

simple integration problem: which answer is correct of the two, "0.5" or "-2"?

Status
Not open for further replies.

PG1995

Active Member
Hi

Could you please help me with the query included in the **broken link removed**? Thank you.

Regards
PG
 
Hi

Could you please help me with the query included in the **broken link removed**? Thank you.

Regards
PG

Somehow I got -3. You can double check my math and see if I made a mistake.

I use the substitution u=0.5t-3/2 which gives dt=2du and limits of u=-3 to u=-1

[latex]\int_{-3}^1 g_4(t) dt=2\cdot \int_{-3}^{-1} g_1(u)\cdot du=2\cdot \frac{-3}{2}=-3[/latex]
 
Hi,

I tried to check your solution.
Your equation for CD, DA, AB, and BE are correct.
However, you did not solve for what is required.
Your solution shows the integral of g1(t) from -3 to 1.
What is required is integral of g4(t)=g1(t-3 / 2) from -3 to 1.
I think you missed a step.

m8
 
Thank you, Steve, M8.

@Steve: Thanks for the solution. The book's answer was wrong.

What is required is integral of g4(t)=g1(t-3 / 2) from -3 to 1.

@meowth08: You are quite right. I also realized that but then I used Steve's method of substitution instead. But I will try to do it the way I originally thought.

Regards
PG
 
Last edited:
Hello,


Well actually the result for part d is really -3. So i wonder if the answers given in the book are to be taken as mutually exclusive.

The easiest way to see how this works is to first map the function g4 using g1. g1 maps to g4 as shown in the attachment in red.
The function shown in red is easily seen to have area equal to 3.333333 under the x axis and +0.333333 above the x axis, making the total equal to -3.000000 square units. A more accurate graphing shows this a little better though.

The second way to verify this result is to define several functions, over the range of g1 where it is not zero. Each function is a straight line so can be represented in slope intercept form:
y=m*x+b
This means defining one function for each slope of g1, and solving for each slope and y intercept for each. The functions can then be added together with each one having an accompanying logical time statement. For example, g1a(t) would be defined as:
g1a(t)=(t>-3)*(t<-2)*(m*t-6)
with m=-2.
Doing each segment of g1 like this and then adding all the functions together:
g1=g1a(t)+g1b(t)+g1c(t)+...
and then integrating numerically from -3 to 1, the result should come out to -3 or very close to it like -2.9999 which would be close enough.
 
Last edited:
Hi MrAl

Aren't I also doing the **broken link removed** which you are suggesting that I should define functions separately? There was a flaw in what I was doing as meowth08 pointed out above.

MrAl said:
For example, g1a(t) would be defined as: g1a(t)=(t>-3)*(t<-2)*(m*t-6) with m=-2.

**broken link removed** you see I also defined the section C-->D in this way. By the way, I don't get why you are multiplying time restrictions or boundaries with the main defined function for that interval.

Regards
PG
 
Last edited:
Hi PG,


well if you did the same thing and didnt get the right answer then you probably just made a simple mistake which once corrected solves the problem.

I just took another look (the writing was a little hard to read) and i see that you did not do the same thing, that's the problem. When we use the logical relations:
c=(t>a)*(t<b)
when t is greater than a but less than b we get c=1, but for t outside this range we get 0. So this little time function acts as a numerical selector, that selects the function that it is multiplied by. For example, the first function is:
f1=-2-6*t
but we multiply it by the time selector for that period, which is:
c=(t>-2)*(t<-3)
and so we get:
f1=(t>-2)*(t<-3)*(-2*-6*t)
The next function is f2 which goes from -2 to -1 so we get:
f2=(t>-1)*(t<-2)*(3*t+4)
So now when t is between -1 and -2 only function f2 contributes to the integration. however, keep in mind that these are still just part of the g1 function, and so far has nothing to do with g4. We cant integrate these directly, we have to do that via function g4 which is:
g4(t)=g1((t-3)/2)
And now we can integrate numerically (assuming we add the other functions):
Result=Integral[-3 to 1](g4(t)) dt

To do this numerically, you could just use the time selector functions shown above and integrate the whole thing numerically. The time selector functions will switch the proper functions in when the time is between the lower and upper limits. Note however that the time values are the transformed time values not the time values of the original limits.

I thought i had made this a little clearer with the red function i drew on your diagram. That shows the actual function you are integrating.

To help make this a little more clear, we can just do the mapping from g1a to h1a for example, which gives us:
h1a(t)=g1a((t-3)/2)
h1b(t)=g1b((t-3)/2)
h1c(t)=g1c((t-3)/2)
h1d(t)=g1d((t-3)/2)
so then h1 is:
h1(t)=h1a(t)+h1b(t)+h1c(t)+h1d(t)
and now we integrate h1(t) from -3 to 1.
Note g1a through g1d are the functions you already found multiplied by it's time selector such as:
g1a=(-2*t-6)*(t>-3)*(t<-2)
etc. for g1b through g1d.
But since we can graph this new function h1(t) we see we can redefine it as:
H1a(t)=-t-3 {from t=-3 to t=-1}
H1b(t)=(3*t-1)/2 {from t=-1 to +1}
So we could integrate those two functions with those two sets of limits instead and sum the results. The result is -3. H1(t) is the plot shown in red in your diagram which i drew on with the two sets of limits imposed.

So that's two ways to do it, but notice that we could not integrate the original function piece by piece unless we do it numerically over the whole range and where we make a new function with the time selectors (it is then all one function, g4(t)).
 
Last edited:
Hi

For this post I think we can ignore the integration issue rather please help me with the queries **broken link removed**. The queries are related to problem already being discussed. Thank you.

Regards
PG
 
Last edited:
These inequalities are not the right formulation to map one variable "t" to the other variable "u". It's just a matter of simple substitution.

u=0.5t-1.5

t=-3 => u=-3
t=-2 => u=-2.5
t=-1 => u=-2
t=0 => u=-1.5
t=1 => u=-1
t=2 => u=-0.5
t=3 => u=0

Notice that the u-axis scaling has been compressed by a factor of 2.
 
Last edited:
These inequalities are not the right formulation to map one variable "t" to the other variable "u". It's just a matter of simple substitution.

u=0.5t-1.5

t=-3 => u=-3
t=-2 => u=-2.5
t=-1 => u=-2
t=0 => u=-1.5
t=1 => u=-1
t=2 => u=-0.5
t=3 => u=0

Notice that the u-axis scaling has been compressed by a factor of 2.

Hi there Steve,

Are you referring to the inequalities such as (t>-3)*(t<-2) or the like?
Those inequalities help to map the entire curve. Rather than map just one, two or a few points, they map the ENTIRE curve using just ONE function call rather than four or more. This allows using numerical integration to check the results using perhaps other methods. Without those inequalities it would be hard to find the limits of integration for each segment i think. You could try and see what you find.
Here is another form:

g1(t)=if t>-3 and t<-2 then -2*t-6 else if t>-2 and t<-1 then 3*t+4 else if t>-1 and t<0 then t+2 else if t>0 and t<1 then 2-3*t
else if t>1 and t<2 then 4*t-5 else if t>2 and t<3 then 9-3*t else 0


I didnt think u substitution was a good idea for this problem because we had a discontinuous function, but feel free to elaborate how you did the integration step by step show every little detail and explaining why each part works.

Here's a graph of the original function and the new mapping. It also shows the area we are concerned about and how we end up with the result of -3. The blue lines are the original function, the red lines are the new function. The shaded areas are the areas of concern, and above the x axis they are positive and below they are negative.
 
Last edited:
Thank you, Steve, MrAl.

@MrAl: I was waiting for your comment on **broken link removed** because more or less I was trying to do what you were saying. Although Steve did comment, he is looking at the problem from substitution point of view which really worked for me that day. But now I'm just curious to see how to make this method work. Thanks.

Regards
PG
 
I didnt think u substitution was a good idea for this problem because we had a discontinuous function, but feel free to elaborate how you did the integration step by step show every little detail and explaining why each part works.

Thanks MrAl,

Yes, I just misunderstood the method being used. What you describe seems fine. What threw me off was that PG seemed to show limits overlapping which should not happen. But, looking again, it appears that he just had one point off, so no problem there.

I can explain my approach. Basically, I just do the substitution symbolically replacing g4(t) with g1(u), and determining the new limits appropriately. Then doing the integration is just a matter of looking at the areas under the curve, which is easy because the curve is piecewise linear over the region. There are only two regions that need to be considered and the areas of these regions are easily determined by inspection.

I did it out very quickly because I was in a rush, and when I got -3 I assumed I had made a simple mental error, which I then left for PG to figure out. However, it appears the book answer was wrong, and -3 is correct.
 
Hi again Steve and PG,


PG:
I think you made a mistake on some of your inequality signs, although i think i still see what you were getting at. You may want to take another look.
Ok, so lets assume you got the right limits which it seems you were after, now did you try to integrate 'something' using those limits? See what you get when you try this.

Steve:
Well, i really need to see your logic step by step. What you said here is basically the same thing as you said previously. The reason i am asking for a complete breakdown of the problem the way you did it is because u substitution is usually used on continuous functions.
You have to realize that we could have gotten lucky here and just happened to get -3, that happens a lot. For example, did you try it on any other discontinuous functions other than the one g1(t) we had been looking at?
So you replaced (t-3)/2 by u, right?
Then calculated du=2*dx right?
Then integrated 2*u du right?
Then using that indefinite integration (it's better this way) calculated the integral between two limits.
How did you determine what limits to use and why?
Also, when did you replace the u with the original function(s)?
 
Last edited:
Hi

I made an **broken link removed**.

@MrAl: Please have a look on this **broken link removed**. Actually I had already made a query about this very point in this post; it was **broken link removed**. Thank you.

Regards
PG
 
Last edited:
Steve:
Well, i really need to see your logic step by step. What you said here is basically the same thing as you said previously.

Hi MrAl,

No problem. I can clarify what I did in this attachment.

Basically, the substitution is done at the symbolic level in terms of g1 and g4, so the nature of the function (continuous or discontinuous) is not important, as long as the functions involved are integrable.

After that, one could choose to break the regions down to have line-functions in each region, then write the equation for the line and then integrate in each region over appropriate limits. However, these functions are simple enough to determine the area directly by inspection.

To find the area by inspection, I generate 3 right-triangular regions. Knowing that the area of a right-triangle is half the area of the rectangle (defined by the short sides) allows me to find the area simply by noting the lengths of the sides of the rectangles of each region.

Steve
 

Attachments

  • Integral.jpg
    Integral.jpg
    467.4 KB · Views: 432
Hello again Steve and PG,

PG:
That function is exactly what you get when you substitute (t-3)/2 into the six equations we get from the original drawn function g1(t). It doesnt matter if it exceeds any other limit or equation because we dont integrate the whole thing, only part of it.

Steve:
Ok that makes more sense, but to make sure i understand you correctly, would you mind doing one more problem almost the same?
This one is where we use the same six functions in PG's original drawing (as we have been using all along called g1) but with one simple change, we make the guts of g4 equal to (t-5)/2 instead of the original (t-3)/2. I think this new 'u' will shed much more light on this. Thanks and thanks for the clarity on the previous one.
 
Last edited:
Ok that makes more sense, but to make sure i understand you correctly, would you mind doing one more problem almost the same?
This one is where we use the same six functions in PG's original drawing (as we have been using all along called g1) but with one simple change, we make the guts of g4 equal to (t-5)/2 instead of the original (t-3)/2. I think this new 'u' will shed much more light on this. Thanks and thanks for the clarity on the previous one.


Hmmm, that one seems even easier, but i suspect you may have something up your sleeve here. :)

So, i'll just work it out and see if something tricky is happening.

I got -2, with almost no work at all

I use the substitution u=0.5t-5/2 which gives dt=2du and limits of u=-4 to u=-2

[latex]\int_{-3}^1 g_4(t) dt=2\cdot \int_{-4}^{-2} g_1(u)\cdot du=2\cdot (-1)=-2[/latex]

The region from -4<u<-3 has no area at all because G1 is zero in that zone. And, the area under G1 from u=-3 to u=-2 is trivially equal to -1.
 
Last edited:
Hi Steve,

Oh ok very good, thanks. That is the right result i believe. I would find it hard to believe that we could get two correct results using this method if it didnt work. What i was doing was searching for the limit of the method more or less.

How about one more, a little more tricky but lets see what happens...

Instead of g4=g1((t-3)/2) or the last, try using g4=g1((t^2-3/2). This is a non linear u this time.
 
Hi Steve,

Oh ok very good, thanks. That is the right result i believe. I would find it hard to believe that we could get two correct results using this method if it didnt work. What i was doing was searching for the limit of the method more or less.

How about one more, a little more tricky but lets see what happens...

Instead of g4=g1((t-3)/2) or the last, try using g4=g1((t^2-3/2). This is a non linear u this time.

Ha, that one is of course more tricky, and not done by inspection in one minute like the others. :)

I can try that one tomorrow evening. It's 12:30 am and i'm off to bed now, and tomorrow we're taking the kids to King Richards Fair for the day. One issue with a direct substitution like that is not only is it nonlinear, but both positive and negative values of t map to the same u. So, care is needed here.
 
Hi Steve,

Yeah a little, but lets see how it goes. I dont know about you but i love doing these problems. It's been years since i studied this stuff formally.

Yeah sure take your time. It was nice of you to get back so quickly with the others too. It's a lot nicer to have a conversation about this stuff when it doesnt take days and days to get a reply.

If you would like to do u=(t^3)/2 instead that's fine too, where the u will generate both positive and negative values as before.

Hope you *have* lots of fun with the kiddies tomorrow (or *had* fun if you read this later on in the day) :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top