Think about what a change of variable is, then figure out how to apply that to the data.
Aka, when you make a substitution for y=ln(y), that just means you take your y list, and just take the ln of that. That now because the new measurement for what used to be the y-axis.
Does that make sense?
http://en.wikibooks.org/wiki/Programming:C_contents is a good start. Especially about the bits, and initializing arrays question, along with the short answer questions.
For the sorting question, I recommend http://en.wikipedia.org/wiki/Sorting_algorithm, but since you are a beginner the...
Alright, so doing the integration here's what I get:
1/2\int e^{-t/50}sin(t)dt
u=e^{-t/50},du=-1/50e^{-t/50},dv=sin(t)dt,v=-cos(t)
1/2\int e^{-t/50}sin(t)dt=1/2(-e^{-t/50}cos(t)-\int 1/50e^{-t/50}cos(t)dt
u=1/50e^{-t/50},du=-1/2500e^{-t/50}dt,dv=cos(t)dt, v=sin(t)...
Yes, that's the general idea. If he wants you to print your arrays then you'd have to just call the index of the array you want to print. I'm not sure I'm understanding your question.
Read http://en.wikibooks.org/wiki/C_Programming/Arrays and see if that helps. Unless you clarify exactly what...
Thanks for the fast reply.
In question 2 though.. I have no idea how to integrate that though :(. It's been a long while since I've taken my calc classes. Any ideas?
In question 3, I just used mu because it was easier to write. Quick question though.. c_2=-1/ \sqrt{3} should be c_2=- \sqrt {...
Well, you'll want to jal around until a condition (aka eof or rather a \0 is encountered at the end of the string). I doubt that anyone here will write this homework assignment for you. If, however you do provide at least an attempt at a solution I can help you, or I'm sure someone else will...
Your code is WAY more complicated than it has to be :)
First of all, let's look at the problem and try to write out a general solution in pseudocode about what we need to do.
So you start off by checking if either n1 or n2 have length of less than zero, and if so then return -1. This is...
The code is very simple, but what does your professor want you to use the arrays for?
Without your clarification, I'm going to guess that he wants you to store the information about each year in an array.
int dep_array[10];
int val_array[10];
for(year=1;year<=10;year++) {...
Homework Statement
Solve the IVP and find the interval in which the solution exists
y'=2ty2, y(0)=y0>0
Homework Equations
The Attempt at a Solution
y'=2ty2
y'/y2=2t
\inty-2y'=\int2t
-1/y=t2+c\Rightarrow c = -1/y0
and therefore y= -1/(t^2-1/y_0)
So it appears that the...
It shouldn't matter in the end, as it should come out to be the same? I mean, yp=yp1+yp2 right? The reason I'm splitting it appart is because it's easier to solve for (for me at least) than when everything is combined. But yeah, y=yc+yp
So I guess the correct answer continue something like...
y'' - 3y' + 2y = et + t2
r = 1, 2 -> yc = c1et+c2e2t
yp1 = Atet since Aet is a linear combination of our solution to yc.
yp2 = At2+Bt+C
y'p2 = 2At+B
y''p2 = 2A
via substitution we have
2A-3(2At+B)+2(At2+Bt+C) = t2
by isolating terms:
2At2 = t2
2A = 1 -> A = 1/2
-6At +...