# Tracing a curve from set of dy/dx values

#### rahulpsharma

Joined Sep 5, 2010
59
Hello,
Lets say I have a set of dy/dx values taken at different times (t1, t2, t3 and so on....)...

Using these values, can I trace a curve of y = f(x)...??

If so, how...

Thanks in adv and regards
Rahul

#### boostbuck

Joined Oct 5, 2017
381
Personally I reach for a spreadsheet, as the graphing tools on these are up to anything I need. In my case LibreOffice Calc.

#### atferrari

Joined Jan 6, 2004
4,699
Hello,
Lets say I have a set of dy/dx values taken at different times (t1, t2, t3 and so on....)...

Using these values, can I trace a curve of y = f(x)...??

If so, how...

Thanks in adv and regards
Rahul
Having your data ordered in columns allows Excel to graphic them in real time: you change one point and the graph changes instantly as well.

#### Papabravo

Joined Feb 24, 2006
20,384
You actually need some more things like a starting point, and the relationship between t (time) and x (distance). then the process follows recursively according to:

$y_{n+1}\;=\;y_0\;+\;\frac{dy}{dx}\cdot\Delta x\;=\;y_0\;+\;\frac{dy}{dx}\cdot(x_1\;-\;x_0)$

xox

#### click_here

Joined Sep 22, 2020
548
You'll need to integrate it - i.e. take the area under the graph.

#### Papabravo

Joined Feb 24, 2006
20,384
You'll need to integrate it - i.e. take the area under the graph.
AND, you still need a starting point.

#### Ian0

Joined Aug 7, 2020
8,387
You can choose an arbitirary y value for the starting point, because there will be an arbitrary constant of integration i.e the "+c" that comes at the end.
start at t1 on the x axis, and then proceed at a slope of the first value of dy/dx until you reach halfway between t1 and t2 on the x axis. Then proceed at the second value of dy/dx until you reach halfway between t2 and t3 on the x axis. etc.

#### Papabravo

Joined Feb 24, 2006
20,384
You can choose an arbitirary y value for the starting point, because there will be an arbitrary constant of integration i.e the "+c" that comes at the end.
start at t1 on the x axis, and then proceed at a slope of the first value of dy/dx until you reach halfway between t1 and t2 on the x axis. Then proceed at the second value of dy/dx until you reach halfway between t2 and t3 on the x axis. etc.
The 'arbitrary constant' only occurs in an indefinite integral. There is no such thing with a definite integral where you know the limits of integration.

xox

#### MrChips

Joined Oct 2, 2009
29,217
As others have stated, you integrate.

Start with the first dy/dx value = y1 and add the next dy/dx value = sum = y2.
Keep on accumulating the sum by adding every next value = sum = yn.

You will be missing the starting value y0 which could be any value which needs to added on to every value yn.

It is like an AC + DC signal without the DC (i.e. a high pass filter).

#### wayneh

Joined Sep 9, 2010
17,405
Lets say I have a set of dy/dx values taken at different times (t1, t2, t3 and so on....)...

Using these values, can I trace a curve of y = f(x)...??
No, you cannot. To have any hope, you'd need to know the relationship of "x" to "t".

Imagine you're hiking in the mountains. You can measure the slope along the south-to-north axis every hour. That's your data set, slope against time. Can you map your hike from that data? Nope. You could be anywhere in the world.

Even if you know your precise starting location, your rambling path could not be mapped using only the slope data. You need to know x versus t.

xox

#### click_here

Joined Sep 22, 2020
548
From a practical point of view, saying that that T0 is (0,0,0) is fine and the following points are relative to that. That is unless you have some sort of co-ordinate system that you must use.

Even then, you could just shift/convert the values when presenting the results, such as converting them to long/lat values...

#### rahulpsharma

Joined Sep 5, 2010
59
Thank you all for your replies...!! I collected the following from above:
1) First I need to have a relation between x and t (Not sure if I really have that)
2) I can integrate EACH dy/dx and get one value of yi... And the curve wud be the points (x1,y1), (x2, y1 + y2), (x3, y1 + y2 + y3), (xi , y1 + y2 + y3 + ...... + yi)....!!
3) I would require a starting point value...

I hope the above understanding is correct...!!

Regarding 1) above, I am not sure if I have that relation...!!

Actually, I am trying to tinker with the following:

I have a portfolio of equities which changes by a certain percentage (+ / -) each day with the change in Stock Index %age...!!

So at the End of the day, it says that my portfolio has changed by -0.5% and the Stock Market Index changed by -0.25% or something similar...!!

Now, I am considering the change in my Equity Portfolio as 'de' and change in stock index as 'di' at the end of the day...!! So just for fun sake, I was trying to plot the two (i vs e) using the di/de relation (if that's applicable in this case)...!! Basically my understanding of differentials is that de reflects the sensitivity of e to di...!! And, I am assuming, that's precisely happening with my equity portfolio wrt to stock market index...!! Hence, I got a little curious to derive the curve from this differential relation...!!

Ofcourse, I understand, an easier way wud be to simply plot the absolute values and that wud be it...!! But I was trying to do it the 'hard' way... ...!!

Not sure, if this info refines my original question further...!!

Thanks a lot indeed for your replies and regards
Rahul

#### wayneh

Joined Sep 9, 2010
17,405
Thank you all for your replies...!! I collected the following from above:
1) First I need to have a relation between x and t (Not sure if I really have that)
2) I can integrate EACH dy/dx and get one value of yi... And the curve wud be the points (x1,y1), (x2, y1 + y2), (x3, y1 + y2 + y3), (xi , y1 + y2 + y3 + ...... + yi)....!!
3) I would require a starting point value...

I hope the above understanding is correct...!!

Regarding 1) above, I am not sure if I have that relation...!!

Actually, I am trying to tinker with the following:

I have a portfolio of equities which changes by a certain percentage (+ / -) each day with the change in Stock Index %age...!!

So at the End of the day, it says that my portfolio has changed by -0.5% and the Stock Market Index changed by -0.25% or something similar...!!

Now, I am considering the change in my Equity Portfolio as 'de' and change in stock index as 'di' at the end of the day...!! So just for fun sake, I was trying to plot the two (i vs e) using the di/de relation (if that's applicable in this case)...!! Basically my understanding of differentials is that de reflects the sensitivity of e to di...!! And, I am assuming, that's precisely happening with my equity portfolio wrt to stock market index...!! Hence, I got a little curious to derive the curve from this differential relation...!!

Ofcourse, I understand, an easier way wud be to simply plot the absolute values and that wud be it...!! But I was trying to do it the 'hard' way... ...!!

Not sure, if this info refines my original question further...!!

Thanks a lot indeed for your replies and regards
Rahul
Well in this example you have everything you need, since each data point is one day apart. It’s common in analyzing business time-series data to plot the natural log against time. Using percentage changes is essentially the same technique.

Try plotting the percent change in your portfolio against the change in your index. The correlation coefficient is the beta for the portfolio.

#### MrChips

Joined Oct 2, 2009
29,217
Note that when plotting dollar values in things such as stock, commodity, equity values, it is better to use a log scale (or what is known as a ratio scale). A base-2 log scale is more useful than a linear scale.

#### click_here

Joined Sep 22, 2020
548
>There is no graph to integrate without the relationship between x and t.

There are data points - You can integrate using the data points. It's done in digital signal processing (DSP) all the time.

Have a look at the link in my last post.

#### wayneh

Joined Sep 9, 2010
17,405
>There is no graph to integrate without the relationship between x and t.

There are data points - You can integrate using the data points. It's done in digital signal processing (DSP) all the time.

Have a look at the link in my last post.
By all means, go for it. Show us.

#### wayneh

Joined Sep 9, 2010
17,405
You mean like the example on the Riemann sums link I shared?