Untitled22

139 days ago by asddd12333

#도함수의 활용 #함수의 증가와 감소, 극대와 극소를 판정하고 설명할 수 있다. - 1 #28번 global answer import random def problem_num(): var('x') a = randint(1, 5) b = randint(-5, 5) f(x) = -x^3 + a*x + b df = diff(f(x), x) c = solve(df == 0, x)[0].rhs() d = solve(df == 0, x)[1].rhs() while c == d: a = randint(1, 5) b = randint(-5, 5) if c > d: c1 = c c = d d = c1 answer = f(x = d) return answer, x, a, b, c, d def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] return answer, x, a, b, c, d def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [x, a, b, c, d]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] d = problem_number_list[4] f(x) = -x^3 + a*x + b fp = plot(f(x), -10, 10) h = point([(d, f(x = d))], color = 'red', size = 15) random.shuffle(select_answer_list) show(html("<p>함수 $f(x) = -x^3 + ax +b$ 가 $x = %s$ 에서 극솟값 $%s$ 을 가질 때, 극댓값을 구하여라.</p>"%(latex(c), latex(f(x = c))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> $f(x)$ 가 $x = %s$ 에서 극소값 $%s$ 을 가지므로, <br> $f(%s) = -(%s)^3 + a\\times %s + b = %s$ 이고 <br> $f'(x) = -3x^2 + a$ 에서 $f'(%s) = -3\\times(%s)^2 + a = 0$ 을 연립하면 $a = %s, b = %s$임을 알 수 있다. <br> 따라서 $f(x) = -x^3 + %s x + %s$ 이고, 다른 극값의 x좌표는 $%s$ 가 된다. <br> 따라서 정답은 $f(%s) = -(%s)^3 + %s \\times %s + %s = %s$ 이다."%(latex(c), latex(f(x = c)), latex(c), latex(c), latex(c), latex(f(x=c)), latex(c), latex(c), latex(a), latex(b), latex(a), latex(b), latex(d), latex(d), latex(d), latex(a), latex(d), latex(b), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> $f(x)$ 가 $x = %s$ 에서 극소값 $%s$ 을 가지므로, <br> $f(%s) = -(%s)^3 + a\\times %s + b = %s$ 이고 <br> $f'(x) = -3x^2 + a$ 에서 $f'(%s) = -3\\times(%s)^2 + a = 0$ 을 연립하면 $a = %s, b = %s$임을 알 수 있다. <br> 따라서 $f(x) = -x^3 + %s x + %s$ 이고, 다른 극값의 x좌표는 $%s$ 가 된다. <br> 따라서 정답은 $f(%s) = -(%s)^3 + %s \\times %s + %s = %s$ 이다."%(latex(c), latex(f(x = c)), latex(c), latex(c), latex(c), latex(f(x=c)), latex(c), latex(c), latex(a), latex(b), latex(a), latex(b), latex(d), latex(d), latex(d), latex(a), latex(d), latex(b), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(fp + h, ymin = -10, ymax = 10) 
       

Click to the left again to hide and once more to show the dynamic interactive window

#도함수의 활용 #함수의 증가와 감소, 극대와 극소를 판정하고 설명할 수 있다. - 2 #29번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(-4, -1) b = randint(0, 3) c = randint(-5, 5) df(x) = 3*(x-a)*(x-b) f(x) = indefinite_integral(df(x), x) + c answer = max([f(x = -5), f(x = a), f(x = b), f(x = 4)]) return answer, x, a, b, c def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, x, a, b, c def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [x, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] f(x) = indefinite_integral(3*(x-a)*(x-b), x) + c fp = plot(f(x), -5, 4) h = point([(-5, f(x = -5)), (a, f(x = a)), (b, f(x = b)), (4, f(x = 4))], color = 'red', size = 15) random.shuffle(select_answer_list) show(html("<p>구간 $[-5, 4]$ 에서 함수 $%s$ 의 최댓값을 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> $%s$ 를 미분하면 $(x-(%s))(x-(%s))$ 이 나오므로, 우리는 구간 끝의 함수값과 비교하여 가장 큰 값을 찾아내면 된다. <br> $f(-5) = %s, f(%s) = %s, f(%s) = %s, f(4) = %s$ 이므로 최댓값은 $%s$ 이다."%(latex(f(x)), latex(a), latex(b), latex(f(x=-5)), latex(a), latex(f(x=a)), latex(b), latex(f(x=b)), latex(f(x=4)), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> $%s$ 를 미분하면 $(x-(%s))(x-(%s))$ 이 나오므로, 우리는 구간 끝의 함수값과 비교하여 가장 큰 값을 찾아내면 된다. <br> $f(-5) = %s, f(%s) = %s, f(%s) = %s, f(4) = %s$ 이므로 최댓값은 $%s$ 이다."%(latex(f(x)), latex(a), latex(b), latex(f(x=-5)), latex(a), latex(f(x=a)), latex(b), latex(f(x=b)), latex(f(x=4)), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(fp + h) 
       

Click to the left again to hide and once more to show the dynamic interactive window

#도함수의 활용 #방정식과 부등식에 대한 문제를 해결할 수 있다. #30번 global answer import random def problem_num(): var('x') R.<x> = QQ[] a = randint(-5, 5) b = randint(-5, 5) c = randint(-5, 5) f = x^3 + a*x^2 + b*x + c rr = f.roots(AA, multiplicities=False) answer = len(rr) return answer, x, a, b, c def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, x, a, b, c def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] answer_calc_list = [] random_answer_calc = random.randint(0, 3) while random_answer_calc == answer: random_answer_calc = random.randint(0, 3) for i in range(3): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(0, 3) while random_answer_calc == answer: random_answer_calc = random.randint(0, 3) answer_calc_list.append(random_answer_calc) select_answer = [answer_calc_list[0], answer_calc_list[1], answer_calc_list[2], answer] return [select_answer, answer, [x, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] f(x) = x^3 + a*x^2 + b*x + c fp = plot(f(x), -10, 10) random.shuffle(select_answer_list) show(html("<p>방정식 $%s = 0$ 의 서로 다른 실근의 개수를 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i])), sp, "개") @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> 함수 $y = %s$ 의 그래프는 다음과 같고, $x$ 축과 만나는 점의 갯수가 실근의 갯수이므로 <br> 실근의 갯수는 $%s$ 개다."%(latex(f(x)), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> 함수 $y = %s$ 의 그래프는 다음과 같고, $x$ 축과 만나는 점의 갯수가 실근의 갯수이므로 <br> 실근의 갯수는 $%s$ 개다."%(latex(f(x)), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(fp, ymin = -20, ymax = 20) 
       

Click to the left again to hide and once more to show the dynamic interactive window

#도함수의 활용 #속도와 가속도에 대한 문제를 해결할 수 있다. #31번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('t') a = randint(1, 4) b = randint(5, 10) c = randint(-5, 5) df(t) = (t-a)*(t-b) ddf(t) = diff(df(t), t) answer = ddf(t = a) return answer, t, a, b, c def problem(): prob = problem_num() answer = prob[0] t = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, t, a, b, c def problem_answer_list(): var('t') prob = problem() answer = prob[0] t = prob[1] a = prob[2] b = prob[3] c = prob[4] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [t, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] t = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] f(t) = indefinite_integral((t-a)*(t-b), t) + c fp = plot(f(t), max(a-5, 0), b+5) random.shuffle(select_answer_list) show(html("<p>원점을 출발하여 수직선 위를 움직이는 점 $P$ 의 시각 $t$ 에서의 위치가 $x = %s$라 한다. <br> 점 $P$ 가 출발한 후 처음으로 운동방향을 바꿀 때의 점 $P$ 의 가속도를 구하여라.</p>"%(latex(f(t))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') te = LatexExpr('t = ') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, te, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> 점 $P$ 의 시각 $t$ 에서의 위치가 $x = %s$ 이므로, 속도를 $v$ , 가속도를 $a$ 라고 하면 <br> $v = \\frac{dx}{dt} = %s$ , $a = \\frac{dv}{dt} = %s$ 이다. <br> 점 $P$가 방향을 바꿀 때의 속도는 $0$ 이므로 <br> $%s = (t-%s)(t-%s) = 0$ <br> 따라서 $t = %s \\ or \\ %s$ 이다. <br> 따라서 $t = %s$ 일 때 처음으로 운동 방향을 바꾸므로, 구하는 가속도는 $2 \\times %s - %s = %s$ 이다. "%(latex(f(t)), latex(diff(f(t), t)), latex(diff(diff(f(t), t), t)), latex(diff(f(t), t)), latex(a), latex(b), latex(a), latex(b), latex(a), latex(a), latex(a+b),latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> 점 $P$ 의 시각 $t$ 에서의 위치가 $x = %s$ 이므로, 속도를 $v$ , 가속도를 $a$ 라고 하면 <br> $v = \\frac{dx}{dt} = %s$ , $a = \\frac{dv}{dt} = %s$ 이다. <br> 점 $P$가 방향을 바꿀 때의 속도는 $0$ 이므로 <br> $%s = (t-%s)(t-%s) = 0$ <br> 따라서 $t = %s \\ or \\ %s$ 이다. <br> 따라서 $t = %s$ 일 때 처음으로 운동 방향을 바꾸므로, 구하는 가속도는 $2 \\times %s - %s = %s$ 이다. "%(latex(f(t)), latex(diff(f(t), t)), latex(diff(diff(f(t), t), t)), latex(diff(f(t), t)), latex(a), latex(b), latex(a), latex(b), latex(a), latex(a), latex(a+b),latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(fp, ymin = f(t=b)-10, ymax = f(t=a)+10) 
       

Click to the left again to hide and once more to show the dynamic interactive window

#적분 #부정적분의 뜻을 안다. #33번 global answer import random def problem_num(): var('x') a = randint(-5, 5) b = randint(-5, 5) c = randint(-5, 5) f(x) = a*x^3 + b*x^2 +c*x answer = diff(f(x), x) return answer, x, a, b, c def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, x, a, b, c def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0]*x^2 + answer_calc_list[1]*x, answer+answer_calc_list[1], answer+answer_calc_list[2]*x+answer_calc_list[3], answer+answer_calc_list[3]*x^2+answer_calc_list[0]*x+answer_calc_list[2], answer] return [select_answer, answer, [x, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] f(x) = a*x^3 + b*x^2 +c*x fp = plot(diff(f(x), x)) random.shuffle(select_answer_list) show(html("<p>$\\int{f(x)dx} = %s + C$ 를 만족시키는 함수 $f(x)$ 를 구하여라. (단, $C$ 는 상수)</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') fe = LatexExpr('f(x) = ') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, fe, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> $f(x) = (%s + C)'$ 이므로 <br> $f(x) = %s$ 이다. "%(latex(f(x)), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> $f(x) = (%s + C)'$ 이므로 <br> $f(x) = %s$ 이다. "%(latex(f(x)), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(fp) 
       

Click to the left again to hide and once more to show the dynamic interactive window

#적분 #함수의 실수배, 합, 차의 부정적분을 알고, 다항함수의 부정적분을 구할 수 있다. - 1 #35번 global answer import random def problem_num(): var('x') a = randint(-5, 5) b = randint(-5, 5) c = randint(-5, 5) answer = [a, b, c] return answer, x, a, b, c def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, x, a, b, c def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] acl = [] q = random.randint(-3, 3) while len(acl)<12 or acl[0:2] == acl[3:5] or acl[0:2] == acl[6:8] or acl[0:2] == acl[9:11] or acl[3:5] == acl[6:8] or acl[3:5] == acl[9:11] or acl[6:8] == acl[9:11]: for i in range(12): q = random.randint(-3, 3) acl.append(q) select_answer = [[answer[0]+acl[0], answer[1]+acl[1], answer[2]+acl[2]], [answer[0]+acl[3], answer[1]+acl[4], answer[2]+acl[5]], [answer[0]+acl[6], answer[1]+acl[7], answer[2]+acl[8]], [answer[0]+acl[9], answer[1]+acl[10], answer[2]+acl[11]], answer] return [select_answer, answer, [x, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] s = list(IntegerRange(5)) random.shuffle(s) select_answer_list2 = [] for i in range(5): select_answer_list2.append(select_answer_list[s[i]]) show(html("<p>$\\frac{d}{dx} {\\int(ax^2 + (%s) + (%s))dx} = %s + bx + c$ 를 만족시키는 상수 $a, b, c$ 의 값을 구하여라.</p>"%(latex(b*x), latex(c), latex(a*x^2)))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') ae = LatexExpr('a = ') be = LatexExpr('b = ') ce = LatexExpr('c = ') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, ae, latex(expand(select_answer_list2[i][0])), sp, be, latex(expand(select_answer_list2[i][1])), sp, ce, latex(expand(select_answer_list2[i][2]))) @interact def _(answers = selector([(None, ""), (select_answer_list2[0], "1"), (select_answer_list2[1], "2"), (select_answer_list2[2], "3"), (select_answer_list2[3], "4"), (select_answer_list2[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> $\\frac{d}{dx} {\\int(ax^2 + (%s) + (%s))dx} = %s + bx + c$ 에서 <br> $ax^2 + (%s) + (%s) = %s + bx + c$ <br> 따라서 $a = %s, b = %s, c = %s$ 이다."%(latex(b), latex(c), latex(a), latex(b), latex(c), latex(a), latex(a), latex(b), latex(c)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> $\\frac{d}{dx} {\\int(ax^2 + (%s) + (%s))dx} = %s + bx + c$ 에서 <br> $ax^2 + (%s) + (%s) = %s + bx + c$ <br> 따라서 $a = %s, b = %s, c = %s$ 이다."%(latex(b), latex(c), latex(a), latex(b), latex(c), latex(a), latex(a), latex(b), latex(c)))) fl = open("record.txt",'w') fl.write('fail') fl.close() 
       

Click to the left again to hide and once more to show the dynamic interactive window

#적분 #함수의 실수배, 합, 차의 부정적분을 알고, 다항함수의 부정적분을 구할 수 있다. - 2 #36번 global answer import random def problem_num(): var('x') a = randint(-5, 5) b = randint(-5, 5) c = randint(-5, 5) d = randint(-5, 5) r = randint(-5, 5) g(x) = diff(diff(x^4 + a*x^3 + b*x^2, x), x) answer = g(x = r) return answer, x, a, b, c, d, r def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] r = prob[6] return answer, x, a, b, c, d, r def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] r = prob[6] answer_calc_list = [] random_answer_calc = random.randint(-30, 30) while random_answer_calc == 0: random_answer_calc = random.randint(-30, 30) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-30, 30) while random_answer_calc == 0: random_answer_calc = random.randint(-30, 30) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [x, a, b, c, d, r]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] d = problem_number_list[4] r = problem_number_list[5] h(x) = x^4 + a*x^3 + b*x^2 +c*x + d f(x) = diff(h(x), x) g(x) = diff(f(x), x) random.shuffle(select_answer_list) show(html("<p>$%s$ 이 함수 $f(x)$ 의 부정적분 중 하나이고, $f(x)$ 가 함수 $g(x)$의 부정적분 중 하나일 때, $g(%s)$ 의 값을 구하여라.</p>"%(latex(h(x)), latex(r)))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, "g(%s) ="%(r), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> $%s$ 이 $f(x)$ 의 부정적분 중 하나이므로 <br> $f(x) = (%s)' = %s$ 이고, <br> $f(x) = %s$ 가 $g(x)$ 의 부정적분 중 하나이므로 <br> $g(x) = (%s)' = %s$ 이다. <br> 따라서 $g(%s) = %s$ 이다. "%(latex(h(x)), latex(h(x)), latex(f(x)), latex(f(x)), latex(f(x)), latex(g(x)), latex(r), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> $%s$ 이 $f(x)$ 의 부정적분 중 하나이므로 <br> $f(x) = (%s)' = %s$ 이고, <br> $f(x) = %s$ 가 $g(x)$ 의 부정적분 중 하나이므로 <br> $g(x) = (%s)' = %s$ 이다. <br> 따라서 $g(%s) = %s$ 이다. "%(latex(h(x)), latex(h(x)), latex(f(x)), latex(f(x)), latex(f(x)), latex(g(x)), latex(r), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() 
       

Click to the left again to hide and once more to show the dynamic interactive window

#정적분 #정적분의 뜻을 안다. #41번 global answer import random def problem_num(): var('x') a = randint(-5, 5) b = randint(-5, 5) c = randint(-5, 5) d = randint(-5, 5) answer = integral(a*x^3 + b*x^2 + c*x + d, x, -3, 3) return answer, x, a, b, c, d def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] return answer, x, a, b, c, d def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] answer_calc_list = [] random_answer_calc = random.randint(-30, 30) while random_answer_calc == 0: random_answer_calc = random.randint(-30, 30) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-30, 30) while random_answer_calc == 0: random_answer_calc = random.randint(-30, 30) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [x, a, b, c, d]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] d = problem_number_list[4] f(x) = a*x^3 + b*x^2 + c*x + d random.shuffle(select_answer_list) show(html("<p>함수 $%s$ 에 대하여 정적분 <br><br> $\\int_{1}^{4}{f(x)dx} - \\int_{3}^{4}{f(x)dx} + \\int_{-3}^{1}{f(x)dx}$ <br><br> 를 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> (주어진 식) $= \\int_{1}^{3}{f(x)dx} + \\int_{-3}^{1}{f(x)dx}$ <br> $= \\int_{-3}^{3}{f(x)dx} = \\int_{-3}^{3}(%s dx)$ <br> $= \\int_{-3}^{3}{%s dx} + \\int_{-3}^{3}{%s dx} + \\int_{-3}^{3}{%s dx} + \\int_{-3}^{3}{%s dx}$ <br> $= 0 + 2\\int_{0}^{3}{%s dx} + 0 + 2\\int_{0}^{3}{%s dx} = %s$ 이다. "%(latex(f(x)), latex(a*x^3), latex(b*x^2), latex(c*x), latex(d), latex(b*x^2), latex(d), latex(answer) ))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> (주어진 식) $= \\int_{1}^{3}{f(x)dx} + \\int_{-3}^{1}{f(x)dx}$ <br> $= \\int_{-3}^{3}{f(x)dx} = \\int_{-3}^{3}(%s dx)$ <br> $= \\int_{-3}^{3}{%s dx} + \\int_{-3}^{3}{%s dx} + \\int_{-3}^{3}{%s dx} + \\int_{-3}^{3}{%s dx}$ <br> $= 0 + 2\\int_{0}^{3}{%s dx} + 0 + 2\\int_{0}^{3}{%s dx} = %s$ 이다. "%(latex(f(x)), latex(a*x^3), latex(b*x^2), latex(c*x), latex(d), latex(b*x^2), latex(d), latex(answer) ))) fl = open("record.txt",'w') fl.write('fail') fl.close() 
       

Click to the left again to hide and once more to show the dynamic interactive window

#정적분 #다항함수의 정적분을 구할 수 있다. #38번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(-5, 5) b = randint(-5, 5) c = randint(-5, 5) answer = 0 return answer, x, a, b, c def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, x, a, b, c def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] select_answer = [integral(a*x^2 + b*x + c, x, -2, 2), integral(a*x^2 + b*x + c, x, 0, 2), indefinite_integral(a*x^2 + b*x + c, x), integral(a*x^2 + b*x + c, x, 0, 1), answer] return [select_answer, answer, [x, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] f(x) = a*x^2 + b*x + c random.shuffle(select_answer_list) show(html("<p>다음 정적분 $\\int_{2}^{2}(%s)dx$ 을 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> 적분 구간이 $2$ 부터 $2$ 로 같은 곳이기 때문에, 적분값은 $0$ 이다. <br> 즉, $\\int_{2}^{2}(%s)dx = 0$ 이다."%(latex(f(x))))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> 적분 구간이 $2$ 부터 $2$ 로 같은 곳이기 때문에, 적분값은 $0$ 이다. <br> 즉, $\\int_{2}^{2}(%s)dx = 0$ 이다."%(latex(f(x))))) fl = open("record.txt",'w') fl.write('fail') fl.close() 
       

Click to the left again to hide and once more to show the dynamic interactive window

#정적분 #다항함수의 정적분을 구할 수 있다. #43번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x, k') a = randint(-5, 5) f(x) = x^3 + a*x^2 + k b = solve(integral(f(x), x, 0, 2)==k, k)[0].rhs() g(x) = x^3 + a*x^2 + b answer = g(x = 1) return answer, x, a, b, k def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] k = prob[4] return answer, x, a, b, k def problem_answer_list(): var('x, k') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] k = prob[4] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [x, a, b, k]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] k = problem_number_list[3] f(x) = x^3 + a*x^2 + k random.shuffle(select_answer_list) show(html("<p> $f(x) = %s + \\int_{0}^{2}{f(t)}dt$ 를 만족시키는 함수 $f(x)$ 에 대하여 $f(1)$ 의 값을 구하여라.</p>"%(latex(f(x)-k)))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> 정적분 값은 상수이므로 $\\int_{0}^{2}{f(t)}dt = a$ ( $a$ 는 상수) 로 놓으면 <br> $f(x) = %s + a$ 라 할 수 있다. <br> 즉, $a = \\int_{0}^{2}{f(t)}dt = \\int_{0}^{2}(%s + a)dt$ 이고, 이를 계산하면 $a = %s$ 이다. <br> 따라서 $f(x) = %s + a = %s$ 이며 $f(1) = %s$ 이다. "%(latex(f(x)-k), latex(f(x)-k), latex(b), latex(f(x)-k), latex(f(x)-k+b), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> 정적분 값은 상수이므로 $\\int_{0}^{2}{f(t)}dt = a$ ( $a$ 는 상수) 로 놓으면 <br> $f(x) = %s + a$ 라 할 수 있다. <br> 즉, $a = \\int_{0}^{2}{f(t)}dt = \\int_{0}^{2}(%s + a)dt$ 이고, 이를 계산하면 $a = %s$ 이다. <br> 따라서 $f(x) = %s + a = %s$ 이며 $f(1) = %s$ 이다. "%(latex(f(x)-k), latex(f(x)-k), latex(b), latex(f(x)-k), latex(f(x)-k+b), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() 
       

Click to the left again to hide and once more to show the dynamic interactive window

#정적분의 활용 #곡선으로 둘러싸인 도형의 넓이를 구할 수 있다. #47번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(0, 4) b = randint(0, 4) c = randint(-5, 0) d = randint(0, 5) g(x) = indefinite_integral(2*x - 2*a, x) + c h(x) = indefinite_integral(-2*x + 2*b, x) + d e = solve(g(x) == h(x), x)[0].rhs() f = solve(g(x) == h(x), x)[1].rhs() if e > f: e1 = e e = f f = e1 answer = integral(h(x)-g(x), x, e, f) return answer, x, a, b, c, d, e, f def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] e = prob[6] f = prob[7] return answer, x, a, b, c, d, e, f def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] c = prob[4] d = prob[5] e = prob[6] f = prob[7] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [x, a, b, c, d, e, f]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] x = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] d = problem_number_list[4] e = problem_number_list[5] f = problem_number_list[6] g(x) = indefinite_integral(2*x - 2*a, x) + c h(x) = indefinite_integral(-2*x + 2*b, x) + d gh = plot(h(x), e, f, fill=g(x)) + plot(h(x), e-3, f+3) + plot(g(x), e-3, f+3) random.shuffle(select_answer_list) show(html("<p> 두 곡선 $y = %s, y = %s$ 으로 둘러싸인 부분의 넓이를 구하여라.</p>"%(latex(g(x)), latex(h(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> 두 곡선 $y = %s, y = %s$ 의 교점의 $x$ 좌표는 <br> $%s = %s$ 에서 $%s = 0$ 이므로 <br> $x = %s$ 또는 $x = %s$ 이다. <br> 따라서 그림에서 구하는 넓이는 $\\int_{%s}^{%s}{%s dx} = [%s]_{%s}^{%s} = %s$ 이다."%(latex(g(x)), latex(h(x)), latex(g(x)), latex(h(x)), latex(g(x)-h(x)), latex(e), latex(f), latex(e), latex(f), latex(h(x)-g(x)), latex(indefinite_integral(h(x)-g(x), x)), latex(e), latex(f), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> 두 곡선 $y = %s, y = %s$ 의 교점의 $x$ 좌표는 <br> $%s = %s$ 에서 $%s = 0$ 이므로 <br> $x = %s$ 또는 $x = %s$ 이다. <br> 따라서 그림에서 구하는 넓이는 $\\int_{%s}^{%s}{%s dx} = [%s]_{%s}^{%s} = %s$ 이다."%(latex(g(x)), latex(h(x)), latex(g(x)), latex(h(x)), latex(g(x)-h(x)), latex(e), latex(f), latex(e), latex(f), latex(h(x)-g(x)), latex(indefinite_integral(h(x)-g(x), x)), latex(e), latex(f), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(gh) 
       

Click to the left again to hide and once more to show the dynamic interactive window

#정적분의 활용 #속도와 거리에 대한 문제를 해결할 수 있다. #49-2번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('t') a = randint(1, 3) b = randint(1, 5) c = randint(1, 5) while b == c or b > c: b = randint(1, 5) c = randint(1, 5) f(t) = a*(t-b)*(t-c) answer = integral(f(t), t, 0, b) - integral(f(t), t, b, c) + integral(f(t), t, c, 6) return answer, t, a, b, c def problem(): prob = problem_num() answer = prob[0] t = prob[1] a = prob[2] b = prob[3] c = prob[4] return answer, t, a, b, c def problem_answer_list(): var('t') prob = problem() answer = prob[0] t = prob[1] a = prob[2] b = prob[3] c = prob[4] answer_calc_list = [] random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-10, 10) while random_answer_calc == 0: random_answer_calc = random.randint(-10, 10) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1], answer+answer_calc_list[2], answer+answer_calc_list[3], answer] return [select_answer, answer, [t, a, b, c]] def final_answer_list(): select_answer = problem_answer_list() select_answer_list = select_answer[0] answer = select_answer[1] problem_number_list = select_answer[2] return [select_answer_list, answer, problem_number_list] final = final_answer_list() select_answer_list = final[0] answer = final[1] problem_number_list = final[2] t = problem_number_list[0] a = problem_number_list[1] b = problem_number_list[2] c = problem_number_list[3] f(t) = a*(t-b)*(t-c) ff = plot(f(t), 0, b, fill=0) + plot(-f(t), b, c, fill=0) + plot(f(t), c, 6, fill=0) + plot(f(t), b, c, linestyle = "--") random.shuffle(select_answer_list) show(html("<p> 수직선 위를 움직이는 점 $P$ 의 시각 $t$ 에서의 속도가 $v(t) = %s$ 일 때, <br> 시각 $t=0$ 에서 $t=6$ 까지 점 $P$ 가 실제로 움직인 거리를 구하여라. </p>"%(latex(f(t).simplify_full())))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i]))) @interact def _(answers = selector([(None, ""), (select_answer_list[0], "1"), (select_answer_list[1], "2"), (select_answer_list[2], "3"), (select_answer_list[3], "4"), (select_answer_list[4], "5")], buttons=True), auto_update=False): if answers == None: show(html("<p><span style='color:blue'>Please input your answer in the spaces above.</span></p><p>(위의 빈칸에 답을 입력하고 [Update(확인)] 버튼을 클릭하세요.)</p>")) else: if answer == answers: show(html("<p><span style='color:blue'>Correct(정답)</span></p><p>Answer(답안): <br> $t=0$ 에서 $t=6$ 까지 점 $P$ 가 실제로 움직인 거리는 <br> $\\int_{0}^{6}{|%s| dt} = \\int_{0}^{%s}(%s) dt + \\int_{%s}^{%s}(%s) dt + \\int_{%s}^{6}(%s) dt$ <br> $[%s]_{0}^{%s} + [%s]_{%s}^{%s} + [%s]_{%s}^{6} = %s + %s + %s = %s$ 이다."%(latex(f(t).simplify_full()), latex(b), latex(f(t).simplify_full()), latex(b), latex(c), latex(-f(t).simplify_full()), latex(c), latex(f(t).simplify_full()), latex(indefinite_integral(f(t), t)), latex(b), latex(indefinite_integral(-f(t), t)), latex(b), latex(c), latex(indefinite_integral(f(t), t)), latex(c), latex(integral(f(t), t, 0, b)), latex(integral(-f(t), t, b, c)), latex(integral(f(t), t, c, 6)), latex(answer)))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> $t=0$ 에서 $t=6$ 까지 점 $P$ 가 실제로 움직인 거리는 <br> $\\int_{0}^{6}{|%s| dt} = \\int_{0}^{%s}(%s) dt + \\int_{%s}^{%s}(%s) dt + \\int_{%s}^{6}(%s) dt$ <br> $[%s]_{0}^{%s} + [%s]_{%s}^{%s} + [%s]_{%s}^{6} = %s + %s + %s = %s$ 이다."%(latex(f(t).simplify_full()), latex(b), latex(f(t).simplify_full()), latex(b), latex(c), latex(-f(t).simplify_full()), latex(c), latex(f(t).simplify_full()), latex(indefinite_integral(f(t), t)), latex(b), latex(indefinite_integral(-f(t), t)), latex(b), latex(c), latex(indefinite_integral(f(t), t)), latex(c), latex(integral(f(t), t, 0, b)), latex(integral(-f(t), t, b, c)), latex(integral(f(t), t, c, 6)), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() show(ff) 
       

Click to the left again to hide and once more to show the dynamic interactive window