Click on a sideways triangle to expand it. Then you can see what's inside it.
<Text-field style="Heading 1" layout="Heading 1">Undetermined Coefficients and Maple</Text-field>
<Text-field style="Heading 2" layout="Heading 2">A walk through how to get Maple to determine some undetermined coefficients. </Text-field> Let's say we want the solutions to y''+2y'+2y=(x^2+3x+2)e^x. The corresponding homogeneous equation is y''+2y'+2y=0. This has a solution set consisting of all linear combinations of y_1(x)=e^x*cos(x) and y_2(x)=e^x*sin(x). The missing piece of the puzzle is to find a "point on the plane", that is, to find a particular function y_p so that y_p(x)''+2y_p(x)'+2y_p(x) will work out to (x^2+3x+2)e^x. We expect that the solution will be of the form (c_2x^2+c_1x+c_0)e^x. Thus, we fire up Maple. QyQ+SSJmRzYiLCgqJkkjYzJHRiUiIiJJInhHRiUiIiNGKSomSSNjMUdGJUYpRipGKUYpSSNjMEdGJUYpRik= LCgqJkkjYzJHNiIiIiJJInhHRiUiIiNGJiomSSNjMUdGJUYmRidGJkYmSSNjMEdGJUYm QyQ+SSJnRzYiKiZJImZHRiUiIiItSSRleHBHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHRiU2I0kieEdGJUYoRig= KiYsKComSSNjMkc2IiIiIkkieEdGJiIiI0YnKiZJI2MxR0YmRidGKEYnRidJI2MwR0YmRidGJy1JJGV4cEc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkdGJjYjRihGJw== QyQ+SSZsaW5vcEc2ImYqNiNJInlHRiVGJTYkSSlvcGVyYXRvckdGJUkmYXJyb3dHRiVGJSwoLUklZGlmZkclKnByb3RlY3RlZEc2JDkkLUkiJEdGLzYkSSJ4R0YlIiIjIiIiLUYuNiRGMUY1RjZGMUY3RiVGJUYlRjc= Zio2I0kieUc2IkYlNiRJKW9wZXJhdG9yR0YlSSZhcnJvd0dGJUYlLCgtSSVkaWZmRyUqcHJvdGVjdGVkRzYkOSQtSSIkR0YsNiRJInhHRiUiIiMiIiItRis2JEYuRjJGM0YuRjRGJUYlRiU= QyQtSSZsaW5vcEc2IjYjLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliR0YlNiNJInhHRiUiIiI= LCQtSSRleHBHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHNiI2I0kieEdGKCIiJQ== QyQtSSZsaW5vcEc2IjYjKiRJInhHRiUiIiQiIiI= LChJInhHNiIiIicqJEYjIiIjRiUqJEYjIiIkIiIi QyQ+SSJoRzYiLUkmbGlub3BHRiU2I0kiZ0dGJSIiIg== LCgqJkkjYzJHNiIiIiItSSRleHBHNiQlKnByb3RlY3RlZEdJKF9zeXNsaWJHRiU2I0kieEdGJUYmIiIjKiYsJiomRiRGJkYtRiZGLkkjYzFHRiVGJkYmRidGJiIiJSomLCgqJkYkRiZGLUYuRiYqJkYyRiZGLUYmRiZJI2MwR0YlRiZGJkYnRiZGMw== We want this is to come out to (x^2+3x+2)e^x. Perhaps maple can just solve? QyQtSSZzb2x2ZUc2IjYkL0kiaEdGJSomLCgqJEkieEdGJSIiIyIiIkYsIiIkRi1GLkYuLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliR0YlNiNGLEYuNyVJI2MwR0YlSSNjMUdGJUkjYzJHRiVGLg== NyM3JS9JI2MwRzYiLDJJI2MyRzYiIyEiIiIiIyomSSNjMkc2IiIiIkkieEc2IiIiIiEiI0kjYzFHNiIhIiIqJkkjYzJHNiIiIiJJInhHNiIiIiMhIiIqJkkjYzFHNiIiIiJJInhHNiIiIiIhIiIqJEkieEc2IiIiIyMiIiIiIiVJInhHNiIjIiIkIiIlIyIiIiIiIyIiIi9JI2MxRzYiSSNjMUc2Ii9JI2MyRzYiSSNjMkc2Ig== No good! This is nonsense. It's trying to make our constants depend on x. When faced with this kind of a snafu, one way around is root around inside Maple until it is sufficiently mastered to be able to put the question in the syntax Maple wants. Another way is to root around the math until it is sufficiently simplified that the question you will set Maple is one that there can be no grammar or syntax misunderstandings about. QyQ+SSVlcW4xRzYiLUklc3Vic0clKnByb3RlY3RlZEc2JC9JInhHRiUiIiIvSSJoR0YlKiYsKCokRisiIiNGLEYrIiIkRjJGLEYsLUkkZXhwRzYkRihJKF9zeXNsaWJHRiU2I0YrRixGLA== LywoKiZJI2MyRzYiIiIiLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliR0YmNiNGJ0YnIiIjKiYsJkYlRi5JI2MxR0YmRidGJ0YoRiciIiUqJiwoRiVGJ0YxRidJI2MwR0YmRidGJ0YoRidGMiwkRigiIic= QyQ+SSVlcW4yRzYiLUklc3Vic0clKnByb3RlY3RlZEc2JC9JInhHRiUiIiMvSSJoR0YlKiYsKCokRitGLCIiIkYrIiIkRixGMkYyLUkkZXhwRzYkRihJKF9zeXNsaWJHRiU2I0YrRjJGMg== LywoKiZJI2MyRzYiIiIiLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliR0YmNiMiIiNGJ0YuKiYsJkYlIiIlSSNjMUdGJkYnRidGKEYnRjEqJiwoRiVGMUYyRi5JI2MwR0YmRidGJ0YoRidGMSwkRigiIzc= QyQ+SSVlcW4zRzYiLUklc3Vic0clKnByb3RlY3RlZEc2JC9JInhHRiUiIiQvSSJoR0YlKiYsKCokRisiIiMiIiJGK0YsRjJGM0YzLUkkZXhwRzYkRihJKF9zeXNsaWJHRiU2I0YrRjNGMw== LywoKiZJI2MyRzYiIiIiLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliR0YmNiMiIiRGJyIiIyomLCZGJSIiJ0kjYzFHRiZGJ0YnRihGJyIiJSomLChGJSIiKkYzRi5JI2MwR0YmRidGJ0YoRidGNCwkRigiIz8= There. That's three equations. With luck, there will be only one choice of c0, c1, and c2 that make all three equations come true. If so, only that choice of c's can make the overall equation come true not just at x=1, x=2, and x=3, but everywhere. When we have our c's, we'll check. QyQtSSZzb2x2ZUc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkc2IjYkNyVJJWVxbjFHRihJJWVxbjJHRihJJWVxbjNHRig3JUkjYzBHRihJI2MxR0YoSSNjMkdGKCIiIg== NyM3JS9JI2MwRzYiIyIiIiIiKS9JI2MxRzYiIyIiIiIiJS9JI2MyRzYiIyIiIiIiJQ== QyQtSSVzdWJzRyUqcHJvdGVjdGVkRzYkNyUvSSNjMEc2IiMiIiIiIikvSSNjMUdGKiNGLCIiJS9JI2MyR0YqRjAvSSJoR0YqKiYsKCokSSJ4R0YqIiIjRixGOSIiJEY6RixGLC1JJGV4cEc2JEYlSShfc3lzbGliR0YqNiNGOUYsRiw= LywoLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliRzYiNiNJInhHRikjIiIiIiIjKiYsJkYrRiwjRi0iIiVGLUYtRiRGLUYyKiYsKCokRitGLkYxRitGMSNGLSIiKUYtRi1GJEYtRjIqJiwoRjVGLUYrIiIkRi5GLUYtRiRGLQ== QyQtSSdleHBhbmRHJSpwcm90ZWN0ZWRHNiNJIiVHNiIiIiI= LywoLUkkZXhwRzYkJSpwcm90ZWN0ZWRHSShfc3lzbGliRzYiNiNJInhHRikiIiMqJkYkIiIiRitGLiIiJComRiRGLkYrRixGLkYj And there we are. Now in this, I suppressed various difficulties you might encounter. How, for instance, would you know that subs([list of substitutions],expression); is the command that plugs in the values for c0, c1, and c2 that you're checking? You might click on Help (top of window, to the right of File, Edit, etc.) and in the search window, type substitute and back comes some stuff about a Maple command called "subs". Check it out. JSFH
<Text-field style="Heading 2" layout="Heading 2">Your turn</Text-field> Here you go. Use Maple to solve y''+2y'+2y=g, where g is your own personalized g. g=exp(a*x)*(b*x^2+c*x+d), where a, b, c, and d are the first four digits of your University ID number. JSFH JSFH Use CTRL j (hold the CTRL key down with left pinky, hit the j key), to get more red > prompts to work with.) JSFH JSFH And now, let the plot thicken. Now, with the same b, c, and d, solve y''+2y'+2y=exp(-x)*sin(x)*(bx^2+cx+d). Things don't quite work out so simply as before. The difficulty is in some ways a reflection of the difficulty in solving y''+0y"+0y=x*exp(0*x). The oblivious version of undetermined coefficients tries to get a solution of the form y=a*x+b. And it never works. One needs to cast a somewhat wider net. JSFH JSFH JSFH