Skip to content

DSolveValue ​

Solves a linear, constant-coefficient ODE of order 1 or 2 for Y(x), with optional initial conditions.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageDSolveValue✓
DSolveValue(eqn, Y(x), x)the general solution, with arbitrary constants C(1) (and C(2) for order 2).
DSolveValue({eqn, ic1, ic2, ...}, Y(x), x)the particular solution satisfying the stated initial conditions.
Typed signatures
TypePackageApplies
(expression, expression, symbol) -> expressionanalyticalways

Domain: Analytic

Details
  • Y'/Y'' are written the way compute-engine itself represents an undifferentiated function's derivative -- D(Y(x), x) / D(Y(x), x, x) (boxing to Apply(Derivative(Y, n), x)) -- no new notation introduced. An initial condition is the same shape applied at a NUMBER instead of x: Equal(D(Y(x), x), b) at x=0 is Equal(Apply(Derivative(Y, 1), 0), b) for Y′(0)=bY'(0)=b. Arbitrary constants print as C(1)/C(2), matching Wolfram's own C[1]/C[2] (confirmed directly: compute-engine's native C, called C(1), stays a plain, inert expression, exactly like Wolfram's own C[1]).
  • Homogeneous part: the characteristic polynomial's roots -- a single real root (order 1); two distinct real roots; a repeated real root ((C(1)+C(2)x)erx(C(1)+C(2)x)e^{rx}); or a complex-conjugate pair (epx(C(1)cos⁡(qx)+C(2)sin⁡(qx))e^{px}(C(1)\cos(qx)+C(2)\sin(qx))).
  • Nonhomogeneous part, by undetermined coefficients, ONE forcing shape at a time (not sums of different shapes): a polynomial in x (any degree), AecxAe^{cx}, or Asin⁡(wx)+Bcos⁡(wx)A\sin(wx)+B\cos(wx). Each gets xsx^s times its own trial basis, s = how many times the forcing's own characteristic value already appears as a homogeneous root (the standard resonance bump) -- confirmed against wolframscript's own DSolveValue for every case below, matching up to relabeling which root gets C(1) vs C(2).
  • Every solution is verified before being returned: substituted back with D, the residual must come back exactly 0 symbolically or measure below 1e-9 at several numeric points -- declining, not guessing, otherwise.
  • Declined: order > 2; a non-constant or non-numeric-literal coefficient (including a leading coefficient of 0); a nonlinear term (Y(x)2Y(x)^2, sin⁡(Y(x))\sin(Y(x)), ...); forcing that mixes shapes or isn't one of the three above; and initial conditions at anything but a plain real-number point.
  • Examples use the unknown function Y (capitalized) rather than y deliberately -- an unrelated repo-wide provenance check reuses one shared compute-engine instance across every reference example, and boxing Derivative(y, n) for a lowercase y marks that SYMBOL incompatibly typed there ever after, which then breaks other examples elsewhere that use bare y as an ordinary variable (confirmed directly). Y avoids the collision; the head itself takes any function name.

Examples

Basic #

Y′′+Y=0⇒C(1)cos⁡x+C(2)sin⁡xY''+Y=0 \Rightarrow C(1)\cos x + C(2)\sin x — complex-conjugate roots ±i\pm i

live ↗
InDSolveValue(Y′′(x)+Y(x)=0,Y(x),x)\mathrm{DSolveValue}(Y^{\prime\prime}(x)+Y(x)=0, Y(x), x)Outsin⁡(x)C(2)+cos⁡(x)C(1)\sin(x)C(2)+\cos(x)C(1)

Y′′+Y=0, Y(0)=1, Y′(0)=0⇒cos⁡xY''+Y=0,\ Y(0)=1,\ Y'(0)=0 \Rightarrow \cos x

live ↗
InDSolveValue({Y′′(x)+Y(x)=0Y(0)=1Y′(0)=0,Y(x),x)\mathrm{DSolveValue}(\begin{cases}Y^{\prime\prime}(x)+Y(x)=0\\Y(0)=1\\Y^{\prime}(0)=0\end{cases}, Y(x), x)Outcos⁡(x)\cos(x)
Scope #

Y′′−3Y′+2Y=0⇒Y''-3Y'+2Y=0 \Rightarrow roots 1,21,2

live ↗
InDSolveValue(Y′′(x)−3Y′(x)+2Y(x)=0,Y(x),x)\mathrm{DSolveValue}(Y^{\prime\prime}(x)-3Y^{\prime}(x)+2Y(x)=0, Y(x), x)OutC(1)exp⁡(2x)+C(2)exC(1)\exp(2x)+C(2)e^{x}

Y′′−4Y′+4Y=0⇒Y''-4Y'+4Y=0 \Rightarrow repeated root 22

live ↗
InDSolveValue(Y′′(x)−4Y′(x)+4Y(x)=0,Y(x),x)\mathrm{DSolveValue}(Y^{\prime\prime}(x)-4Y^{\prime}(x)+4Y(x)=0, Y(x), x)Out(xC(2)+C(1))exp⁡(2x)(xC(2)+C(1))\exp(2x)

resonance — Y′′+Y=sin⁡xY''+Y=\sin x, forcing frequency matches the homogeneous roots ±i\pm i

live ↗
InDSolveValue(Y′′(x)+Y(x)=sin⁡(x),Y(x),x)\mathrm{DSolveValue}(Y^{\prime\prime}(x)+Y(x)=\sin(x), Y(x), x)Out−xcos⁡(x)2+sin⁡(x)C(2)+cos⁡(x)C(1)-\frac{x\cos(x)}{2}+\sin(x)C(2)+\cos(x)C(1)
About
Examples5
Checked againstWolfram Language 4 agree1 unevaluated
CrosswalkWolfram Language

Implementation

primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree

nativeenginetypescriptpackages/symbols/analysis/analytic/src/dsolve.ts

See also: SeriesCoefficient, CaputoD