Skip to content

Commit 7e02eb9

Browse files
authored
Merge pull request #1029 from benwalt/bug-4751
proposed fix for bugID 4751
2 parents aa45221 + 6931d7e commit 7e02eb9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

OpenProblemLibrary/METU-NCC/Diff_Eq/linear-nonhomog.pg

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ $multiansB = MultiAnswer($y1, $y2, $Wronskian)->with(
115115
if (Formula("$S[0]*$dS[1]") == Formula("$S[1]*$dS[0]")) {
116116
Value::Error("Fundamental solutions not independent!");
117117
}
118-
my @L = ( Formula("$ddS[0] - ($a+$b)*$dS[0] + ($a*$b)*$S[0]")->reduce,
119-
Formula("$ddS[1] - ($a+$b)*$dS[1] + ($a*$b)*$S[1]")->reduce );
120-
if ($L[0] == Formula("0")) { $flag[0] = 1; $msg = "\(y_1\) is fine$BR"; }
118+
119+
if (Formula("$ddS[0] - ($a+$b)*$dS[0]") == Formula("-($a*$b)*$S[0]"))
120+
{ $flag[0] = 1; $msg = "\(y_1\) is fine$BR"; }
121121
else { $msg = "\(y_1\) is not a fundamental solution$BR"; }
122122

123-
if ($L[1] == Formula("0")) { $flag[1] = 1; $msg = $msg . "\(y_2\) is fine$BR"; }
123+
if (Formula("$ddS[1] - ($a+$b)*$dS[1]") == Formula("-($a*$b)*$S[1]"))
124+
{ $flag[1] = 1; $msg = $msg . "\(y_2\) is fine$BR"; }
124125
else { $msg = $msg . "\(y_2\) is not a fundamental solution$BR"; }
125126
}
126127

@@ -220,13 +221,13 @@ $multiansD = MultiAnswer($gen_soln)->with(
220221
if (Formula("$S_h[0]*$dS_h[1]") == Formula("$S_h[1]*$dS_h[0]")) {
221222
Value::Error("Not the most general answer...");
222223
}
223-
if (Formula("$ddS_h[0] - ($a+$b)*$dS_h[0] + ($a*$b)*$S_h[0]") == Formula("0")) {
224+
if (Formula("$ddS_h[0] - ($a+$b)*$dS_h[0]") == Formula("-($a*$b)*$S_h[0]")) {
224225
$msg = "\(y_1\) is okay$BR";
225226
$flag[0] = 1;
226227
} else {
227228
$msg = "\(y_1\) is wrong$BR";
228229
}
229-
if (Formula("$ddS_h[1] - ($a+$b)*$dS_h[1] + ($a*$b)*$S_h[1]") == Formula("0")) {
230+
if (Formula("$ddS_h[1] - ($a+$b)*$dS_h[1]") == Formula("-($a*$b)*$S_h[1]")) {
230231
$msg = $msg . "\(y_2\) is okay$BR";
231232
$flag[1] = 1;
232233
} else {

0 commit comments

Comments
 (0)