Untitled333

131 days ago by asddd12333

#여러 가지 함수의 미분 #사인함수와 코사인함수를 미분할 수 있다. 문제 제작 global answer import random def problem_num(): var('x') a = randint(1, 5) b = randint(1, 5) c = randint(1, 5) d = randint(1, 5) while a*b == b*c: a = randint(1, 5) b = randint(1, 5) c = randint(1, 5) f(x) = a*cos(b*x)+c*sin(d*x) answer = diff(f(x), x) 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] p(x) = diff(c*cos(b*x)+c*sin(d*x), x) q(x) = diff(a*cos(b*x)-c*sin(d*x), x) r(x) = diff(c*cos(b*x)-c*sin(d*x), x) select_answer = [p(x), q(x), r(x), 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] random.shuffle(select_answer_list) show(html("<p> 함수 $y = %s$ 의 도함수를 구하여라.</p>"%(latex(a*cos(b*x)+c*sin(d*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")], 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 = f(g(x))$ 의 도함수는 $y' = f'(g(x))g'(x)$ 임을 이용하자. <br> $f(x) = %s cos(x), \\ g(x) = %s$ 라 두면 $f'(x) = -sin(x), \\ g'(x) = %s$ 이므로 $(%s cos(%s))' = %s$ 이다. <br> 마찬가지로, $f(x) = %s sin(x), \\ g(x) = %s$ 라 두면 $(%s sin(%s))' = %s$ 이다. <br> 따라서 답은 $%s$ 이다."%(latex(a), latex(b*x), latex(b), latex(a), latex(b*x), latex(diff(a*cos(b*x), x)), latex(c), latex(d*x), latex(c), latex(d*x), latex(diff(c*sin(d*x), 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 = f(g(x))$ 의 도함수는 $y' = f'(g(x))g'(x)$ 임을 이용하자. <br> $f(x) = %s cos(x), \\ g(x) = %s$ 라 두면 $f'(x) = -sin(x), \\ g'(x) = %s$ 이므로 $(%s cos(%s))' = %s$ 이다. <br> 마찬가지로, $f(x) = %s sin(x), \\ g(x) = %s$ 라 두면 $(%s sin(%s))' = %s$ 이다. <br> 따라서 답은 $%s$ 이다."%(latex(a), latex(b*x), latex(b), latex(a), latex(b*x), latex(diff(a*cos(b*x), x)), latex(c), latex(d*x), latex(c), latex(d*x), latex(diff(c*sin(d*x), x)), 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

#여러 가지 미분법 #함수의 몫을 미분할 수 있다. 33번 global answer import random def problem_num(): var('x') a = randint(1, 3) b = randint(1, 3) k = randint(-5, 5) r1(x) = choice([a*sin(b*x), a*log(b*x), a*cos(b*x), a*tan(b*x), a*exp(b*x), a*x^2 + b*x]) r2(x) = choice([a*sin(b*x), a*log(b*x), a*cos(b*x), a*tan(b*x), a*exp(b*x), a*x^2 + b*x]) f(x) = (r1(x)+k)/r2(x) answer = diff(f(x), x) return answer, x, a, b, k, r1(x), r2(x) def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] k = prob[4] r1(x) = prob[5] r2(x) = prob[6] return answer, x, a, b, k, r1, r2 def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] k = prob[4] r1(x) = prob[5] r2(x) = prob[6] answer_calc_list = [] random_answer_calc = random.randint(-5,5)/(r2(x)^2) while random_answer_calc == 0: random_answer_calc = random.randint(-5,5)/(r2(x)^2) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-5,5)/(r2(x)^2) while random_answer_calc == 0: random_answer_calc = random.randint(-5,5)/(r2(x)^2) 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, r1(x), r2(x)]] 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] r1(x) = problem_number_list[4] r2(x) = problem_number_list[5] f(x) = (r1(x)+k)/r2(x) dr1(x) = diff(r1(x), x) dr2(x) = diff(r2(x), x) random.shuffle(select_answer_list) show(html("<p> 함수 $y= %s$ 의 도함수를 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') ye = LatexExpr('y=') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, ye, latex(select_answer_list[i].normalize())) @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> 몫의 미분법 $\\Bigl( \\frac{f(x)}{g(x)}\\Bigr)' = \\frac{f'(x)g(x)-f(x)g'(x)}{{g(x)}^2}$ 을 이용하자. <br> $f(x) = %s, \\ g(x) = %s$ 이므로 $f'(x) = %s, \\ g'(x) = %s$ 이다. 이를 위의 식에 대입하면 <br> $\\frac{(%s)(%s)-(%s)(%s)}{(%s)^2} = %s$ 이다."%(latex(r1(x)+k), latex(r2(x)), latex(dr1(x)), latex(dr2(x)), latex(dr1(x)), latex(r2(x)), latex(r1(x)+k), latex(dr2(x)), latex(r2(x)), latex(answer.normalize())))) fl = open("record.txt",'w') fl.write('success') fl.close() else: show(html("<p><span style='color:red'>Incorrect(오답)</span></p><p>Answer(답안): <br> 몫의 미분법 $\\Bigl( \\frac{f(x)}{g(x)}\\Bigr)' = \\frac{f'(x)g(x)-f(x)g'(x)}{{g(x)}^2}$ 을 이용하자. <br> $f(x) = %s, \\ g(x) = %s$ 이므로 $f'(x) = %s, \\ g'(x) = %s$ 이다. 이를 위의 식에 대입하면 <br> $\\frac{(%s)(%s)-(%s)(%s)}{(%s)^2} = %s$ 이다."%(latex(r1(x)+k), latex(r2(x)), latex(dr1(x)), latex(dr2(x)), latex(dr1(x)), latex(r2(x)), latex(r1(x)+k), latex(dr2(x)), latex(r2(x)), latex(answer.normalize())))) 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

#여러 가지 미분법 #합성함수를 미분할 수 있다. 35번 global answer import random def problem_num(): var('x') a = randint(1, 5) b = randint(1, 5) c = randint(1, 5) while a*b == a*c: a = randint(1, 5) b = randint(1, 5) c = randint(1, 5) f(x) = a*cos(b*sin(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] p(x) = diff(-a*cos(b*sin(c*x)), x) q(x) = diff(a*cos(c*sin(b*x)), x) r(x) = diff(-a*cos(c*sin(b*x)), x) select_answer = [p(x), q(x), r(x), 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] random.shuffle(select_answer_list) show(html("<p> 함수 $y = %s$ 의 도함수를 구하여라.</p>"%(latex(a*cos(b*sin(c*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")], 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 = f(g(h(x)))$ 의 도함수는 $y' = f'(g(h(x)))g'(h(x))h'(x)$ 임을 이용하자. <br> $f(x) = %s, \\ g(x) = %s, \\ h(x) = %s$ 라 두면 $f'(x) = %s, \\ g'(x) = %s, \\ h'(x) = %s$ 이므로 <br> $f'(g(h(x))) = %s, \\ g'(h(x)) = %s$ 이고, $h'(x)$ 까지 모두 곱하면 정답은 $%s$ 이다."%(latex(a*cos(x)), latex(b*sin(x)), latex(c*x), latex(diff(a*cos(x), x)), latex(diff(b*sin(x), x)), latex(c), latex(-a*sin(b*sin(c*x))), latex(b*cos(c*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 = f(g(h(x)))$ 의 도함수는 $y' = f'(g(h(x)))g'(h(x))h'(x)$ 임을 이용하자. <br> $f(x) = %s, \\ g(x) = %s, \\ h(x) = %s$ 라 두면 $f'(x) = %s, \\ g'(x) = %s, \\ h'(x) = %s$ 이므로 <br> $f'(g(h(x))) = %s, \\ g'(h(x)) = %s$ 이고, $h'(x)$ 까지 모두 곱하면 정답은 $%s$ 이다."%(latex(a*cos(x)), latex(b*sin(x)), latex(c*x), latex(diff(a*cos(x), x)), latex(diff(b*sin(x), x)), latex(c), latex(-a*sin(b*sin(c*x))), latex(b*cos(c*x)), 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

#도함수의 활용 #접선의 방정식을 구할 수 있다. 36번 global answer import random def problem_num(): var('x') a = randint(-3, 3) while a==0: a = randint(-3, 3) b = randint(-4, 4) f(x) = a*x*exp(x)+b answer = a*x+b return answer, x, a, b def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] return answer, x, a, b def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] answer_calc_list = [] random_answer_calc = random.randint(-2, 2) while random_answer_calc == 0: random_answer_calc = random.randint(-2, 2) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-2, 2) while random_answer_calc == 0: random_answer_calc = random.randint(-2, 2) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0], answer+answer_calc_list[1]*x, answer+answer_calc_list[2], answer+answer_calc_list[3]*x+answer_calc_list[2], answer] return [select_answer, answer, [x, a, b]] 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] f(x) = a*x*exp(x)+b ff = plot(f(x), legend_label=f'${a}xe^x+{b}$')+plot(answer, color='green', legend_label=f'${a}x+{b}$') random.shuffle(select_answer_list) show(html("<p>곡선 $y = %s$ 위의 점 $(0, %s)$ 에서의 접선의 방정식을 구하여라.</p>"%(latex(f(x)), latex(b)))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') ye = LatexExpr('y=') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, ye, 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$ 라 하면 $f'(x) = %s$ 이다. <br> 따라서 점 $(0, %s)$ 에서의 기울기가 $f'(0) = %s$ 이므로 구하는 접선의 방정식은 $y = %s$ 이다."%(latex(f(x)), latex(a*exp(x)+a*x*exp(x)), latex(b), latex(a), 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$ 라 하면 $f'(x) = %s$ 이다. <br> 따라서 점 $(0, %s)$ 에서의 기울기가 $f'(0) = %s$ 이므로 구하는 접선의 방정식은 $y = %s$ 이다."%(latex(f(x)), latex(a*exp(x)+a*x*exp(x)), latex(b), latex(a), 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

#도함수의 활용 #함수의 그래프의 개형을 그릴 수 있다. 40번 global answer import random def problem_num(): var('x') a = randint(-3, 3) while a==0: a = randint(-3, 3) b = randint(-4, 4) while b==0: b = randint(-4, 4) f(x) = (b*x)/(a*ln(x)) answer = f(x=e) return answer, x, a, b def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] return answer, x, a, b def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] answer_calc_list = [] random_answer_calc = random.randint(-2, 2)*e/a while random_answer_calc == 0: random_answer_calc = random.randint(-2, 2)*e/a for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-2, 2)*e/a while random_answer_calc == 0: random_answer_calc = random.randint(-2, 2)*e/a 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]] 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] f(x) = (b*x)/(a*ln(x)) random.shuffle(select_answer_list) show(html("<p>함수 $f(x) = %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> $f(x) = %s$ 에서 분모는 $x=1$ 일 때 0이 되므로 가능한 $x$ 의 범위는 $0$<$x$<$1$, $x$>$1$ 이다. <br> $f'(x) = \\frac{%s - %s x \\times \\frac{%s}{x}}{(%s)^2}$ = $%s$ 이므로 <br> $f'(x)=0$ 이 되는 $x$ 값은 $ln(x)-1 = 0$ 의 해이고, 따라서 $x=e$ 이다. <br> 따라서 $f(x)$ 는 $x=e$ 에서 극값 $f(e) = %s$ 를 가진다."%(latex(f(x)), latex(a*b*ln(x)), latex(b), latex(a), latex(a*ln(x)), latex(diff(f(x), x).simplify_full()), 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$ 에서 분모는 $x=1$ 일 때 0이 되므로 가능한 $x$ 의 범위는 $0$<$x$<$1$, $x$>$1$ 이다. <br> $f'(x) = \\frac{%s - %s x \\times \\frac{%s}{x}}{(%s)^2}$ = $%s$ 이므로 <br> $f'(x)=0$ 이 되는 $x$ 값은 $ln(x)-1 = 0$ 의 해이고, 따라서 $x=e$ 이다. <br> 따라서 $f(x)$ 는 $x=e$ 에서 극값 $f(e) = %s$ 를 가진다."%(latex(f(x)), latex(a*b*ln(x)), latex(b), latex(a), latex(a*ln(x)), latex(diff(f(x), x).simplify_full()), 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(1, 3) b = randint(-4, 4) c = randint(-5, 0) f(x) = (a*x^2+b*x+c)/exp(x) ddf(x) = diff(diff(f(x), x), x).simplify_full() answer = [solve(ddf(x)==0, x)[0].rhs(), solve(ddf(x)==0, x)[1].rhs()] 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(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) answer_calc_list.append(random_answer_calc) select_answer = [[answer[0]+answer_calc_list[0], answer[1]+answer_calc_list[0]], [answer[0]+answer_calc_list[1], answer[1]+answer_calc_list[1]], [answer[0]+answer_calc_list[2], answer[1]+answer_calc_list[2]], [answer[0]+answer_calc_list[3], answer[1]+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) = (a*x^2+b*x+c)/e^x df(x) = diff(f(x), x) ddf(x) = diff(df(x), x) random.shuffle(select_answer_list) show(html("<p>함수 $f(x) = \\frac{%s}{%s}$ 의 모든 변곡점의 $x$좌표를 구하여라.</p>"%(latex(a*x^2+b*x+c), latex(exp(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') xe = LatexExpr('x=') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, xe, latex(expand(select_answer_list[i][0])), ",", spp, xe, latex(expand(select_answer_list[i][1]))) @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) = \\frac{%s}{%s} = %s$ <br> $f'(x) = %s = %s$ <br> $f''(x) = %s = %s$ 이고, <br> $e^x$ 가 0이 아니므로 $f''(x) = 0$ 인 $x$ 는 양변에 $e^x$ 를 곱한 $%s$ 의 해와 같다. <br> 그러므로 $x = %s, %s$ 이다."%(latex(a*x^2+b*x+c), latex(exp(x)), latex(f(x)), latex(df(x)), latex(df(x).simplify_full()), latex(ddf(x)), latex(ddf(x).simplify_full()), latex((ddf(x)*exp(x)).simplify_full()), latex(answer[0]), latex(answer[1])))) 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) = \\frac{%s}{%s} = %s$ <br> $f'(x) = %s = %s$ <br> $f''(x) = %s = %s$ 이고, <br> $e^x$ 가 0이 아니므로 $f''(x) = 0$ 인 $x$ 는 양변에 $e^x$ 를 곱한 $%s$ 의 해와 같다. <br> 그러므로 $x = %s, %s$ 이다."%(latex(a*x^2+b*x+c), latex(exp(x)), latex(f(x)), latex(df(x)), latex(df(x).simplify_full()), latex(ddf(x)), latex(ddf(x).simplify_full()), latex((ddf(x)*exp(x)).simplify_full()), latex(answer[0]), latex(answer[1])))) 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

#여러 가지 적분법 #치환적분법을 이해하고, 이를 활용할 수 있다. 44번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(-2, 2) while a==0: a = randint(-2, 2) b = randint(1, 4) c = randint(3, 5) f(x) = (a*x+b)^c answer = indefinite_integral(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(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0]*x^2, answer+answer_calc_list[2]*x^5 + answer_calc_list[1]*x^3 + answer_calc_list[2]*x, answer+answer_calc_list[2]*x^5 + answer_calc_list[3]*x^4 + answer_calc_list[1]*x^2 + answer_calc_list[3]*x, answer+answer_calc_list[3]*x^5 + answer_calc_list[1]*3*x, 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] var('t') f(x) = (a*x+b)^c random.shuffle(select_answer_list) show(html("<p> $\\int{%s}dx$ 를 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') C = LatexExpr('+C') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i])), C) @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 = t$ 라고 치환하면, $%s dx = dt$ 임을 이용해 치환적분을 할 수 있다. <br> 그러면 주어진 식은 $\\int{\\frac{t^{%s}}{%s}}dt$ 가 되고, 그 값은 $%s + C$ 가 된다. <br> $t = %s$ 로 다시 치환하면 $\\frac{(%s)^{%s}}{%s} + C$ 가 된다. 이를 전개하면 정답은 <br> $%s$ 이다."%(latex(a*x+b), latex(a), latex(c), latex(a), latex(indefinite_integral((t^c)/a, t)), latex(a*x+b), latex(a*x+b), latex(c+1), latex(a*(c+1)), 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 = t$ 라고 치환하면, $%s dx = dt$ 임을 이용해 치환적분을 할 수 있다. <br> 그러면 주어진 식은 $\\int{\\frac{t^{%s}}{%s}}dt$ 가 되고, 그 값은 $%s + C$ 가 된다. <br> $t = %s$ 로 다시 치환하면 $\\frac{(%s)^{%s}}{%s} + C$ 가 된다. 이를 전개하면 정답은 <br> $%s$ 이다."%(latex(a*x+b), latex(a), latex(c), latex(a), latex(indefinite_integral((t^c)/a, t)), latex(a*x+b), latex(a*x+b), latex(c+1), latex(a*(c+1)), 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

#여러 가지 적분법 #부분적분법을 이해하고, 이를 활용할 수 있다. 51번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(-2, 2) while a==0: a = randint(-2, 2) b = randint(1, 4) c = randint(-5, 5) while c==0: c = randint(-5, 5) f(x) = a*ln(b*x)+c answer = indefinite_integral(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(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0]*x, answer+answer_calc_list[2]*x*ln(x) + answer_calc_list[1]*x, answer+answer_calc_list[2]*x*ln(x) + answer_calc_list[3]*x, answer+answer_calc_list[3]*x*ln(x) + answer_calc_list[1]*3*x, 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*ln(b*x)+c random.shuffle(select_answer_list) show(html("<p> $\\int(%s)dx$ 를 구하여라.</p>"%(latex(f(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') C = LatexExpr('+C') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, latex(expand(select_answer_list[i])), C) @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$ 의 미분한 형태가 적분기호안에 존재하지 않으므로 치환적분이 아닌 부분적분을 이용한다. <br> $\\int(%s)dx = \\int(%s \\times %s)dx = %s - \\int{%s}dx = %s + C$ 이므로, <br> 정답은 $%s$ 의 부정적분 $%s$ 까지 더한 $%s + C$ 이다."%(latex(a*ln(b*x)), latex(a*ln(b*x)), latex(a), latex(ln(b*x)), latex(a*x*ln(b*x)), latex(a), latex(a*x*ln(b*x)-a*x), latex(c), latex(c*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> $%s$ 의 미분한 형태가 적분기호안에 존재하지 않으므로 치환적분이 아닌 부분적분을 이용한다. <br> $\\int(%s)dx = \\int(%s \\times %s)dx = %s - \\int{%s}dx = %s + C$ 이므로, <br> 정답은 $%s$ 의 부정적분 $%s$ 까지 더한 $%s + C$ 이다."%(latex(a*ln(b*x)), latex(a*ln(b*x)), latex(a), latex(ln(b*x)), latex(a*x*ln(b*x)), latex(a), latex(a*x*ln(b*x)-a*x), latex(c), latex(c*x), 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

#정적분의 활용 #정적분과 급수의 합 사이의 관계를 이해한다. 54번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(-2, 2) while a==0: a = randint(-2, 2) b = randint(1, 5) answer = a*ln(1+b)/b return answer, x, a, b def problem(): prob = problem_num() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] return answer, x, a, b def problem_answer_list(): var('x') prob = problem() answer = prob[0] x = prob[1] a = prob[2] b = prob[3] answer_calc_list = [] random_answer_calc = random.randint(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-3, 3) while random_answer_calc == 0: random_answer_calc = random.randint(-3, 3) answer_calc_list.append(random_answer_calc) select_answer = [answer+answer_calc_list[0]*ln(1+b), answer+answer_calc_list[2]*ln(1+b), answer+answer_calc_list[2]*ln(1+b), answer+answer_calc_list[3]*ln(1+b), answer] return [select_answer, answer, [x, a, b]] 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] var('n') random.shuffle(select_answer_list) show(html("<p> 무한급수 $\\displaystyle \\lim_{n \\to \\infty} \\biggl( \\frac{%s}{%s}+\\frac{%s}{%s}+\\frac{%s}{%s}+...+\\frac{%s}{%s} \\biggr)$ 의 값을 구하여라.</p>"%(latex(a), latex(n+b), latex(a), latex(n+2*b), latex(a), latex(n+3*b), latex(a), latex(n+n*b)))) 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> $\\displaystyle \\lim_{n \\to \\infty} \\biggl( \\frac{%s}{%s}+\\frac{%s}{%s}+\\frac{%s}{%s}+...+\\frac{%s}{%s} \\biggr) = \\lim_{n \\to \\infty} \\sum_{k=1}^{n}{\\frac{%s}{n+%sk}} = \\lim_{n \\to \\infty} \\sum_{k=1}^{n}{\\frac{%s}{1+%s \\cdot \\frac{k}{n}} \\cdot %s}$ <br> 따라서 $\\frac{k}{n} = x, \\frac{1}{n} = dx$ 라 생각하면 주어진 식은 적분 $\\int_{0}^{1}{\\frac{%s}{1+%s}dx}$ 꼴이 된다. <br> 계산하면 정답은 $[%s]_{0}^{1} = %s$"%(latex(a), latex(n+b), latex(a), latex(n+2*b), latex(a), latex(n+3*b), latex(a), latex(n+n*b), latex(a), latex(b), latex(a), latex(b), latex(1/n), latex(a), latex(b*x), latex(a*ln(1+b*x)/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> $\\displaystyle \\lim_{n \\to \\infty} \\biggl( \\frac{%s}{%s}+\\frac{%s}{%s}+\\frac{%s}{%s}+...+\\frac{%s}{%s} \\biggr) = \\lim_{n \\to \\infty} \\sum_{k=1}^{n}{\\frac{%s}{n+%sk}} = \\lim_{n \\to \\infty} \\sum_{k=1}^{n}{\\frac{%s}{1+%s \\cdot \\frac{k}{n}} \\cdot %s}$ <br> 따라서 $\\frac{k}{n} = x, \\frac{1}{n} = dx$ 라 생각하면 주어진 식은 적분 $\\int_{0}^{1}{\\frac{%s}{1+%s}dx}$ 꼴이 된다. <br> 계산하면 정답은 $[%s]_{0}^{1} = %s$"%(latex(a), latex(n+b), latex(a), latex(n+2*b), latex(a), latex(n+3*b), latex(a), latex(n+n*b), latex(a), latex(b), latex(a), latex(b), latex(1/n), latex(a), latex(b*x), latex(a*ln(1+b*x)/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

#정적분의 활용 #곡선으로 둘러싸인 도형의 넓이를 구할 수 있다. 59번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(1, 2) b = randint(1, 2) f(x) = cos(a*pi*x)==sin(b*pi*x) k = Rational(f(x).find_root(0, 1/2)) answer = integral(cos(a*x)-sin(b*x), x, 0, k*pi).simplify_full() return answer, a, b, k, x def problem(): prob = problem_num() answer = prob[0] a = prob[1] b = prob[2] k = prob[3] x = prob[4] return answer, a, b, k, x def problem_answer_list(): var('x') prob = problem() answer = prob[0] a = prob[1] b = prob[2] k = prob[3] x = prob[4] answer_calc_list = [] random_answer_calc = random.randint(-3,5) while random_answer_calc == 0: random_answer_calc = random.randint(-3,5) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-3,5) while random_answer_calc == 0: random_answer_calc = random.randint(-3,5) 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) = cos(a*x) g(x) = sin(b*x) fg = plot(f(x), 0, k*pi, fill = g(x), legend_label=fr'$\cos({a}x)$') + plot(f(x), k*pi, pi/3) + plot(g(x), 0, pi/3, color = 'green', legend_label=fr'$\sin({b}x)$') + point([(k*pi, f(x = k*pi))], color = 'red', size = 40) random.shuffle(select_answer_list) show(html("<p> $(0 \\leq x \\leq \\frac{\\pi}{4})$ 에서 두 곡선 $y = %s, \\ y = %s$ 및 $y$ 축으로 둘러싸인 부분의 넓이 $S$ 를 구하여라. </p>"%(latex(f(x)), latex(g(x))))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') Se = LatexExpr('S=') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, Se, 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> 두 곡선의 $x$ 좌표는 $%s = %s$ 에서 $x = %s$ 이다. $\\ (\\because 0 \\leq x \\leq \\frac{\\pi}{4})$ <br> $\\because 0 \\leq x \\leq \\frac{\\pi}{4}$ 일 때 $%s \\leq %s$ 이므로 <br> $S = \\int_{0}^{%s}(%s) dx = [%s]_{0}^{%s} = %s$ 이다."%(latex(f(x)), latex(g(x)), latex(k*pi), latex(f(x)), latex(g(x)), latex(k*pi), latex(f(x)-g(x)), latex(indefinite_integral(f(x)-g(x), x)), latex(k*pi), 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> 두 곡선의 $x$ 좌표는 $%s = %s$ 에서 $x = %s$ 이다. $\\ (\\because 0 \\leq x \\leq \\frac{\\pi}{4})$ <br> $\\because 0 \\leq x \\leq \\frac{\\pi}{4}$ 일 때 $%s \\leq %s$ 이므로 <br> $S = \\int_{0}^{%s}(%s) dx = [%s]_{0}^{%s} = %s$ 이다."%(latex(f(x)), latex(g(x)), latex(k*pi), latex(f(x)), latex(g(x)), latex(k*pi), latex(f(x)-g(x)), latex(indefinite_integral(f(x)-g(x), x)), latex(k*pi), latex(answer)))) fl = open("record.txt",'w') fl.write('fail') fl.close() fg.show(ticks=[None, None], tick_formatter=[pi, 1], fontsize=15) 
       

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

#정적분의 활용 #입체도형의 부피를 구할 수 있다. 61번 global answer import random from sage.symbolic.integration.integral import indefinite_integral def problem_num(): var('x') a = randint(-2, -1) b = randint(6, 8) k = randint(2, 3) r = 1/choice([1, 2]) f(x) = (a*x^2 + b*x)**r answer = integral(f(x)**2, x, 0, k).simplify_full() return answer, a, b, k, r, x def problem(): prob = problem_num() answer = prob[0] a = prob[1] b = prob[2] k = prob[3] r = prob[4] x = prob[5] return answer, a, b, k, r, x def problem_answer_list(): var('x') prob = problem() answer = prob[0] a = prob[1] b = prob[2] k = prob[3] r = prob[4] x = prob[5] answer_calc_list = [] random_answer_calc = random.randint(-5,5) while random_answer_calc == 0: random_answer_calc = random.randint(-5,5) for i in range(4): while random_answer_calc in answer_calc_list: random_answer_calc = random.randint(-5,5) while random_answer_calc == 0: random_answer_calc = random.randint(-5,5) 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, 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] k = problem_number_list[3] r = problem_number_list[4] f(x) = (a*x^2 + b*x)**r ff(x) = (f(x)^2).simplify_full() random.shuffle(select_answer_list) show(html("<p> 어떤 입체를 밑면으로부터의 높이가 $x$ 인 곳에서 밑면에 평행한 방향으로 자른 단면이 한 변의 길이가 $%s$ 인 정사각형이라고 한다. <br> 이 입체의 밑면으로부터 높이가 $%s$ 인 부분까지의 부피 $V$ 를 구하시오.</p>"%(latex(f(x)), latex(k)))) sp = LatexExpr('\\quad') spp = LatexExpr('\\qquad') Ve = LatexExpr('V=') for i in range(len(select_answer_list)): show("%s."%(i+1), sp, Ve, 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)$ 라고 하면 <br> $S(x) = (%s)^2 = %s$ 이다. 따라서 구하는 부피 $V$는 <br> $V = \\int_{0}^{%s}{S(x)}dx = \\int_{0}^{%s}(%s)dx = [%s]_{0}^{%s} = %s$ 이다."%(latex(f(x)), latex(f(x)), latex(ff(x)), latex(k), latex(k), latex(ff(x)), latex(indefinite_integral(ff(x), x)), latex(k), 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)$ 라고 하면 <br> $S(x) = (%s)^2 = %s$ 이다. 따라서 구하는 부피 $V$는 <br> $V = \\int_{0}^{%s}{S(x)}dx = \\int_{0}^{%s}(%s)dx = [%s]_{0}^{%s} = %s$ 이다."%(latex(f(x)), latex(f(x)), latex(ff(x)), latex(k), latex(k), latex(ff(x)), latex(indefinite_integral(ff(x), x)), latex(k), 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