{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":54000,"title":"Solve an ODE: first-order linear equation","description":"In the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of people in the world: those who can solve first-order linear ordinary differential equations and those who can’t. By the end of this lecture, you will be in the first group.” \r\nI clearly remember appreciating the cleverness of the integrating factor that we learned that day. I also recall the professor exhorting us not to memorize the final formula but to remember the approach.\r\nWrite a function to solve an equation of the form\r\n\r\nwith the condition . The function should return the values of  at the specified values of .\r\nAlthough MATLAB ODE functions are allowed, I would like someone to demonstrate how to implement the analytical approach using an integrating factor in MATLAB. Those who can will received the coveted unscored bonus points. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 256px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 128px; transform-origin: 407px 128px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.767px 8px; transform-origin: 383.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of people in the world: those who can solve first-order linear ordinary differential equations and those who can’t. By the end of this lecture, you will be in the first group.” \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 378.725px 8px; transform-origin: 378.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eI clearly remember appreciating the cleverness of the integrating factor that we learned that day. I also recall the professor exhorting us not to memorize the final formula but to remember the approach.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 148.45px 8px; transform-origin: 148.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to solve an equation of the form\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOIAAAAlCAYAAABf/TXbAAAJMklEQVR4Xu2cR8smRRDHdz+AGE+i8GI4CIqC6aKCHowgimJAkQXFCIKKigkPZvEkZjzswYiKIigGUFARTKAnD4aDqCcjfgCt3zLllm33dPVM9zzzPjsDxbv7TE93dVX9q6urembrluVaJLBIYOUS2LpyDhYGFgksEtiyAHExgkUCM5DAAsQZKGFhYZHAAsS2NrC3dH+X0B1Cv1YY6nTpY3+hJyv0tXSxUwKHyz/PE7qtklBukn4+FvrI298CRK+kytsBwmeFbhb6qvzx5BMoeUPo6op97spdAcIHhC6q5CyRJbp/VOg1oRc8wm0NxLeEiYOEjq04Sc+8Vt0GRTD360q8YgHTj0nb34VqefCCodeqKSB8pZF9qg3cKf2/mZNaSyAyyS87gzl4FwMiXvC7xkD5Vvq/1qPknBHsovcByieNZXiA9P+50FFC3/fJuSUQ75GBbxW6t7FBzs2OLhCGWLFaO5/jZIzXJxhnbvKtxQ86Aiin1uow0Q9biZNy47QEIh57L483aCyIqbtn3k8JPTjBwJ/JGNCyXywTNgAkYjleyJ1QKRvi39asvL8IXSi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kpt36wc1Nm8CaUSvlbV1mZMvdsIeGW1umGgHD1zxbZcSU2P4enZvpLzjx4m59ImV5sayieJFL6yVvN7mfCiB57DA+kePlsbnoeHFm1SJ788YxFlbTRwTPCErlwOLwZErQ/xHhchIBkoTrqv46cYbCa4xJN6FKygqfnxWt27XCOd5/atWvqAj0eEeNmZrGKLF7a98mjVTg9jDD1njM2f4AWNYxL0d5iQe9sQA2J48DqXgXLwNcsmGCpf4ta6UwsgMnHGyYHGKyC2CN69sXUy9B87sO8dd87tcq+ueXlflZ528BcDonpdQraHChTvnfAc2ukb+TFeaiaCVj1XfTt/uzCyTokZ5Kqhf0zGm26+nj3iqo1pGX+RwNpLYAHi2qt4meBmkMACxM2gpYXHtZfAAsS1V/Eywc0ggX8AkFt0RM3FA/IAAAAASUVORK5CYII=\" alt=\"y' + p(x) y = q(x)\" style=\"width: 113px; height: 18.5px;\" width=\"113\" height=\"18.5\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 22px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 11px; text-align: left; transform-origin: 384px 11px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 56.0167px 8px; transform-origin: 56.0167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewith the condition \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIEAAAAoCAYAAADZs5l2AAAGMklEQVR4Xu2bOastVRCF7/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"64.5\" height=\"20\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 128.742px 8px; transform-origin: 128.742px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The function should return the values of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ey\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 80.9px 8px; transform-origin: 80.9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e at the specified values of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ex\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 361.233px 8px; transform-origin: 361.233px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAlthough MATLAB ODE functions are allowed, I would like someone to demonstrate how to implement the analytical approach using an integrating factor in MATLAB. Those who can will received the coveted unscored bonus points. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = firstOrderLinearODE(x,p,q,x0,y0)\r\n%  ODE y' + p(x) y = q(x) with y(x0) = y0\r\n  y = exp(integral(p,0,x));\r\nend","test_suite":"%%\r\np = @(x) x;\r\nq = @(x) 0;\r\nx0 = 0;\r\ny0 = 1;\r\nx = 0.1:0.1:0.9;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = exp(-x.^2/2);\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\np = @(x) 0;\r\nq = @(x) cos(x);\r\nx0 = 0;\r\ny0 = 1;\r\nx = linspace(pi/51,pi/4);\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = sin(x)+1;\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\np = @(x) 1;\r\nq = @(x) exp(x);\r\nx0 = 0;\r\ny0 = 1;\r\nx = 0:0.5:4;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = cosh(x);\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\np = @(x) -3./x;\r\nq = @(x) x.^2;\r\nx0 = 1;\r\ny0 = 10;\r\nx = 2:0.2:4;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = x.^3.*(10+log(x));\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) 2*x;\r\nq = @(x) x;\r\nx0 = 0;\r\ny0 = -2;\r\nx = 0:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = (1/2)*(1-5*exp(-x.^2));\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) 1./(1+x);\r\nq = @(x) cos(x)./(1+x);\r\nx0 = 0;\r\ny0 = 1;\r\nx = 0:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = (1+sin(x))./(1+x);\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) -2*x;\r\nq = @(x) 1;\r\nx0 = 0;\r\ny0 = 5*rand();\r\nx = 0:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = exp(x.^2).*(y0+(sqrt(pi)/2)*erf(x));\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) 1./x;\r\nq = @(x) sin(x)./x.^2;\r\nx0 = 1;\r\ny0 = 2;\r\nx = 1:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = [];\r\nfor k = 1:length(x)\r\n    y_correct(k) = (1/x(k))*(2+integral(@(t) sin(t)./t,1,x(k)));\r\nend\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\nm = randi(4);\r\nn = randi(4); \r\np = @(x) n./x;\r\nq = @(x) x.^m;\r\nx0 = 1;\r\ny0 = 7*rand();\r\nx = 1:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = (x.^(m+1)-x.^(-n))/(m+n+1)+y0./x.^n;\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\nfiletext = fileread('firstOrderLinearODE.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || contains(filetext, 'system'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-04-16T18:17:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-02-10T04:06:17.000Z","updated_at":"2025-09-02T13:10:46.000Z","published_at":"2022-02-10T04:42:41.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of people in the world: those who can solve first-order linear ordinary differential equations and those who can’t. By the end of this lecture, you will be in the first group.” \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI clearly remember appreciating the cleverness of the integrating factor that we learned that day. I also recall the professor exhorting us not to memorize the final formula but to remember the approach.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to solve an equation of the form\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"y' + p(x) y = q(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\\\\prime+p(x)y = q(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewith the condition \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"y(x0) = y0\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey(x_0) = y_0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The function should return the values of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"y\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e at the specified values of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAlthough MATLAB ODE functions are allowed, I would like someone to demonstrate how to implement the analytical approach using an integrating factor in MATLAB. Those who can will received the coveted unscored bonus points. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":54000,"title":"Solve an ODE: first-order linear equation","description":"In the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of people in the world: those who can solve first-order linear ordinary differential equations and those who can’t. By the end of this lecture, you will be in the first group.” \r\nI clearly remember appreciating the cleverness of the integrating factor that we learned that day. I also recall the professor exhorting us not to memorize the final formula but to remember the approach.\r\nWrite a function to solve an equation of the form\r\n\r\nwith the condition . The function should return the values of  at the specified values of .\r\nAlthough MATLAB ODE functions are allowed, I would like someone to demonstrate how to implement the analytical approach using an integrating factor in MATLAB. Those who can will received the coveted unscored bonus points. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 256px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 128px; transform-origin: 407px 128px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.767px 8px; transform-origin: 383.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of people in the world: those who can solve first-order linear ordinary differential equations and those who can’t. By the end of this lecture, you will be in the first group.” \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 378.725px 8px; transform-origin: 378.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eI clearly remember appreciating the cleverness of the integrating factor that we learned that day. I also recall the professor exhorting us not to memorize the final formula but to remember the approach.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 148.45px 8px; transform-origin: 148.45px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to solve an equation of the form\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOIAAAAlCAYAAABf/TXbAAAJMklEQVR4Xu2cR8smRRDHdz+AGE+i8GI4CIqC6aKCHowgimJAkQXFCIKKigkPZvEkZjzswYiKIigGUFARTKAnD4aDqCcjfgCt3zLllm33dPVM9zzzPjsDxbv7TE93dVX9q6urembrluVaJLBIYOUS2LpyDhYG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An5je9YdPJUAkfYKhJLQqabyWgHRnphRowY01wvxcrOnNMA8c9423FeFYazdv9FfLsxlu8AxLu8pEdWF8hFLOtXUV+2+7B4NIHGhL+zxJyG+CMGVcy7qXFMOrLaeiEDuF0rW2ocAMVVErS30WH8tgGg9LYmaL4RIYGwIfSD0rlDJu4VagomBgxDnlg48D8vf8Dwu4Oerb/AUu29lonyX7nXoQw2tdCWdQsd9YyAfzgSfLUSZimN5L3f6yWW9w35ZFV9KgKOmnvQsbO9LECVAJATYLpRcXifQEgbEhfBLj0Wl2LOrUO68pmeKmti5XRon38j2dJRpQ3iJ0xjyASmeRZct+aswxaIu+k7TxDrSfV9LZ6TllIuFgd6XILxAdH8Ep0h082hswx2vPHKc69fB7IHx3DMl93EenEn1Zkpt36wc1Nm8CaUSvlbV1mZMvdsIeGW1umGgHD1zxbZcSU2P4enZvpLzjx4m59ImV5sayieJFL6yVvN7mfCiB57DA+kePlsbnoeHFm1SJ788YxFlbTRwTPCErlwOLwZErQ/xHhchIBkoTrqv46cYbCa4xJN6FKygqfnxWt27XCOd5/atWvqAj0eEeNmZrGKLF7a98mjVTg9jDD1njM2f4AWNYxL0d5iQe9sQA2J48DqXgXLwNcsmGCpf4ta6UwsgMnHGyYHGKyC2CN69sXUy9B87sO8dd87tcq+ueXlflZ528BcDonpdQraHChTvnfAc2ukb+TFeaiaCVj1XfTt/uzCyTokZ5Kqhf0zGm26+nj3iqo1pGX+RwNpLYAHi2qt4meBmkMACxM2gpYXHtZfAAsS1V/Eywc0ggX8AkFt0RM3FA/IAAAAASUVORK5CYII=\" alt=\"y' + p(x) y = q(x)\" style=\"width: 113px; height: 18.5px;\" width=\"113\" height=\"18.5\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 22px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 11px; text-align: left; transform-origin: 384px 11px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 56.0167px 8px; transform-origin: 56.0167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewith the condition \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIEAAAAoCAYAAADZs5l2AAAGMklEQVR4Xu2bOastVRCF7/sDzpEYOQSCooEDiAYaOCaKgooGDxQnxEDEETFwFk3EEQxeoDhgYOAcKKgIooGiYODAjYwc8Qfo+qAL6tTd3b337nu6+57bBxbnvdO9p6q1q1bt7ntga/nsewsc2PcWWAywtZBgIcFCgoUDW6OT4FEZ/S3hu5GMf7fG+VL4YqTx9uQwY6aDF2Shz4Q3RrTU0RrreeGdkccdcYnDhxqLBBBgW3hq+JSLe4AIHwoPCe8Xt94HDcYgwc2y443CmRPa83iN/Y1whvDrhPOY5dDrJgHG/0U4bwZ5GX1wgXDxLD0x4aTWTQLSAESYg+FJC78L1y76YJVx6ySBRYHLZpSLISVpacrUNOGeTw+9ThJQDt4vrHOMUoNeqgbvCacLY5WppXMc/f51OuhnrQbMIRWYYS0l3KMfpqhURndwzoA5JMBwJws/Cn+ETgn5xyauWSooNfa56uvfxC5tGydnjfGeOZIzZx3Y5jchVjfmn9S1nH5bQzUDXiLcKhzZ9HSLvl8Ovf7ZXP9I39c5ktD+cyHVJk6MEvIK4aLmwl/69qWcpRUuPyY8kLWy9ps4MzhLOKqiH9Y19JMieapPiH+VcJNwQnPDm/q+JtzM4dvVQrRb9jz7IgEs+6qZBKXe2YKPBggtiMLnGHeNcuxJIac0PE33kZ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SBOusTTiftLLbkWiMZ3ux2KHU5n1PUr3pXJ8xmCpdMXvKRKQOw8KPO16u3HeK/pOnUuXGAQyUdcSioYQwUIiO9ufDlpp5CMEazk1w3Al6xjjXhzJWQnPB54W7hI4+EkdzKXmY7rAVw9Wre2IECkSROW+22/n4sShTwZtQXY6iNEoIxGtfqcQgfbi3xn4B2k4uUSMc7+lb9LGgw1L7KBrx0u2KRKYMqecgoVzNSILZYdsC4cLHwib8jeHbJSHm93/XOW66OOGxjbw4HshqSVyNEEq3Cy/bZAFFhJskDNrl7KQoNZyG9RuIcEGObN2KQsJai23Qe0WEmyQM2uXspCg1nIb1O5/ComHOGWac4gAAAAASUVORK5CYII=\" alt=\"y(x0) = y0\" style=\"width: 64.5px; height: 20px;\" width=\"64.5\" height=\"20\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 128.742px 8px; transform-origin: 128.742px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The function should return the values of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ey\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 80.9px 8px; transform-origin: 80.9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e at the specified values of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ex\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 361.233px 8px; transform-origin: 361.233px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAlthough MATLAB ODE functions are allowed, I would like someone to demonstrate how to implement the analytical approach using an integrating factor in MATLAB. Those who can will received the coveted unscored bonus points. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = firstOrderLinearODE(x,p,q,x0,y0)\r\n%  ODE y' + p(x) y = q(x) with y(x0) = y0\r\n  y = exp(integral(p,0,x));\r\nend","test_suite":"%%\r\np = @(x) x;\r\nq = @(x) 0;\r\nx0 = 0;\r\ny0 = 1;\r\nx = 0.1:0.1:0.9;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = exp(-x.^2/2);\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\np = @(x) 0;\r\nq = @(x) cos(x);\r\nx0 = 0;\r\ny0 = 1;\r\nx = linspace(pi/51,pi/4);\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = sin(x)+1;\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\np = @(x) 1;\r\nq = @(x) exp(x);\r\nx0 = 0;\r\ny0 = 1;\r\nx = 0:0.5:4;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = cosh(x);\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\np = @(x) -3./x;\r\nq = @(x) x.^2;\r\nx0 = 1;\r\ny0 = 10;\r\nx = 2:0.2:4;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = x.^3.*(10+log(x));\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) 2*x;\r\nq = @(x) x;\r\nx0 = 0;\r\ny0 = -2;\r\nx = 0:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = (1/2)*(1-5*exp(-x.^2));\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) 1./(1+x);\r\nq = @(x) cos(x)./(1+x);\r\nx0 = 0;\r\ny0 = 1;\r\nx = 0:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = (1+sin(x))./(1+x);\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) -2*x;\r\nq = @(x) 1;\r\nx0 = 0;\r\ny0 = 5*rand();\r\nx = 0:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = exp(x.^2).*(y0+(sqrt(pi)/2)*erf(x));\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\np = @(x) 1./x;\r\nq = @(x) sin(x)./x.^2;\r\nx0 = 1;\r\ny0 = 2;\r\nx = 1:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = [];\r\nfor k = 1:length(x)\r\n    y_correct(k) = (1/x(k))*(2+integral(@(t) sin(t)./t,1,x(k)));\r\nend\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%% \r\nm = randi(4);\r\nn = randi(4); \r\np = @(x) n./x;\r\nq = @(x) x.^m;\r\nx0 = 1;\r\ny0 = 7*rand();\r\nx = 1:0.1:3;\r\ny = firstOrderLinearODE(x,p,q,x0,y0);\r\ny_correct = (x.^(m+1)-x.^(-n))/(m+n+1)+y0./x.^n;\r\nassert(all(abs((y-y_correct)./y_correct)\u003c5e-3))\r\n\r\n%%\r\nfiletext = fileread('firstOrderLinearODE.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || contains(filetext, 'system'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-04-16T18:17:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-02-10T04:06:17.000Z","updated_at":"2025-09-02T13:10:46.000Z","published_at":"2022-02-10T04:42:41.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of people in the world: those who can solve first-order linear ordinary differential equations and those who can’t. By the end of this lecture, you will be in the first group.” \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI clearly remember appreciating the cleverness of the integrating factor that we learned that day. I also recall the professor exhorting us not to memorize the final formula but to remember the approach.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to solve an equation of the form\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"y' + p(x) y = q(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\\\\prime+p(x)y = q(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewith the condition \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"y(x0) = y0\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey(x_0) = y_0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. The function should return the values of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"y\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e at the specified values of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAlthough MATLAB ODE functions are allowed, I would like someone to demonstrate how to implement the analytical approach using an integrating factor in MATLAB. Those who can will received the coveted unscored bonus points. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"tag:\"differential equation\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"differential equation\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"differential equation\"","","\"","differential equation","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f74d90b5338\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f74d90b5298\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f74d90b4938\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f74d90b55b8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f74d90b5518\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f74d90b5478\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f74d90b53d8\u003e":"tag:\"differential equation\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f74d90b53d8\u003e":"tag:\"differential equation\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"differential equation\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"differential equation\"","","\"","differential equation","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f74d90b5338\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f74d90b5298\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f74d90b4938\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f74d90b55b8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f74d90b5518\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f74d90b5478\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f74d90b53d8\u003e":"tag:\"differential equation\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f74d90b53d8\u003e":"tag:\"differential equation\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":54000,"difficulty_rating":"easy-medium"}]}}