To find the quadratic function that models this situation, let x = the number of days and y = the price of the stock. So, you are given three (x,y) ordered pairs: (0,10), (20,20), and (40,25). I'll show you two ways to get the equation: 1) calculator and 2) solving a systems of equations.
1) Calculator method (using a TI-83 or TI-84)
Hit the STAT button, choose EDIT, and enter the x values under L1 and the y values under L2.
Hit the STAT button, choose CALC, then 5: QuadReg
Be sure L1 is in XList and L2 is in YList. Highlight Calculate and enter.
The equation is y = -0.00625x^2 + 0.625x + 10.
2) Set up a system of three equation... you know x and y so you are solving for a, b, and c in ax^2+bx+c
The point (0,10) gives you 0a+0b+c=10. So c=10!
The point (20,20) gives you 400a+20b+c=20. And since c=10, 400a+20b=10
The point (40,25) gives you 1600a+40b+c=25. And since c=10, 1600a+40b=15.
(I assume you can solve for a and b) a=-0.00625 and b=0.625
Now that you have the equation, the function can be written:
s(t) = -0.00625t^2 + 0.625t + 10. When t=30, the price of the stock will be $23.125 so 1000 shares is $23,125.
The "maximum" of the quadratic function is the vertex of the function. The x value of the vertex is easily found using the formula x = -b/2a. so t=50 days. The price of the stock when t=50 is $25.625.
If you sell your 1000 shares that you bought for $23,125 on day 50, your profit is $2500.
Too bad the stock market can't be modeled this way in real life. We would all be billionaires.