Skip to content

Instantly share code, notes, and snippets.

@eric-unc
Created February 12, 2025 03:40
Show Gist options
  • Select an option

  • Save eric-unc/e3d998fb2a94abfded5b00c42a9e60ef to your computer and use it in GitHub Desktop.

Select an option

Save eric-unc/e3d998fb2a94abfded5b00c42a9e60ef to your computer and use it in GitHub Desktop.
>>> What is y if y' = 5x + 2, and y(0) = 0?
<think>
Okay, so I need to find the function y when its derivative y' is equal to 5x plus 2, and also given that y at x equals 0 is 0. Hmm, this seems like a differential equation problem. Let me think step by step.
First, since we're dealing with derivatives, it must be an integration problem because differentiation and integration are inverse operations. So if I have the derivative of a function, to find the original function, I need to integrate it.
The given information is y' = 5x + 2. That means dy/dx equals 5x plus 2. To get y, I should integrate both sides with respect to x.
So let me write that down:
dy/dx = 5x + 2
To find y, we can write:
y = ∫(5x + 2) dx
Now, integrating term by term.
First, the integral of 5x with respect to x. The integral of x^n is (x^(n+1))/(n+1), right? So for 5x, which is 5 times x^1, so n=1. Therefore, the integral would be 5*(x^(2))/2.
Similarly, the integral of 2 with respect to x is 2x because the integral of a constant term 'a' is a*x.
So putting it all together:
y = (5/2)x² + 2x + C
Where C is the constant of integration. That's because when we integrate, we lose information about any constant terms, so we have to account for that with the constant of integration.
Now, I need to find the value of C using the initial condition given: y(0) = 0. So this means when x=0, y=0.
Let me substitute x=0 into the equation:
y(0) = (5/2)*(0)^2 + 2*(0) + C = 0
Calculating each term:
(5/2)*0 is 0,
2*0 is also 0,
and so we have 0 + 0 + C = 0.
So that simplifies to C = 0.
Therefore, the function y is simply:
y = (5/2)x² + 2x
Wait a second, let me double-check my integration and substitution steps to make sure I didn't make any mistakes. Sometimes signs or constants can be tricky.
First, integrating dy/dx = 5x + 2 term by term:
The integral of 5x is indeed (5/2)x² because the power rule states that ∫x^n dx = (x^(n+1))/(n+1), so n=1 here. Then for the constant term 2, integrating gives 2x.
So y = (5/2)x² + 2x + C is correct.
Then applying the initial condition y(0)=0:
Plug in x=0 into this equation: (5/2)(0)² + 2*(0) + C = 0. So indeed, that's 0 + 0 + C = 0, so C=0.
Therefore, my function is correct.
So the final solution is y equals five halves x squared plus two x.
Alternatively, I can write this as:
y = (5/2)x² + 2x
Or to make it look a bit cleaner, maybe factor out an x? Although that might not be necessary here since both terms are already in their simplest forms. Factoring would give y = x*(5/2 x + 2), but I think the original form is clearer.
Let me just check if differentiating my result gives back the original derivative:
dy/dx of (5/2)x² is (5/2)*2x which simplifies to 5x,
and dy/dx of 2x is 2,
so altogether, that's 5x + 2, which matches y' given in the problem. Perfect.
Therefore, everything checks out.
Just to recap:
1. Start with y' = 5x + 2.
2. Integrate term by term: ∫(5x)dx = (5/2)x² and ∫2 dx = 2x.
3. Add constant of integration C: y = (5/2)x² + 2x + C.
4. Use initial condition y(0)=0 to find C:
- Plug in x=0, get 0 + 0 + C = 0 => C=0.
5. Therefore, the solution is y = (5/2)x² + 2x.
I don't think I missed anything here. It seems straightforward once you remember that integrating term by term and using the initial condition to solve for the constant of integration.
So yeah, final answer should be y equals five halves x squared plus two x.
**Final Answer**
The value of \( y \) is \boxed{\frac{5}{2}x^2 + 2x}.
</think>
Given that \( y' = 5x + 2 \) and \( y(0) = 0 \), we need to find the function \( y \).
First, we recognize that \( y' \) is the derivative of \( y \). To find \( y \), we integrate \( y' \) with respect to \( x \):
\[
y = \int (5x + 2) \, dx
\]
We integrate term by term:
1. The integral of \( 5x \) is \( \frac{5}{2}x^2 \).
2. The integral of \( 2 \) is \( 2x \).
Thus, we have:
\[
y = \frac{5}{2}x^2 + 2x + C
\]
where \( C \) is the constant of integration.
Next, we use the initial condition \( y(0) = 0 \) to find \( C \):
\[
0 = \frac{5}{2}(0)^2 + 2(0) + C
\]
This simplifies to:
\[
0 = 0 + 0 + C \implies C = 0
\]
Therefore, the function \( y \) is:
\[
y = \frac{5}{2}x^2 + 2x
\]
The final answer is:
\[
\boxed{\frac{5}{2}x^2 + 2x}
\]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment