print "CHAIN RULE / ADAM'S RULE CALCULATOR" import time time.sleep(2) print "For the polynomial function (yx^a + zx^b)^c..." print x = "x^" import time time.sleep(2) y = int(raw_input('Enter y: ')) print import time time.sleep(2) z = int(raw_input('Enter z: ')) print import time time.sleep(2) print "Time for the exponents!" print import time time.sleep(2) print "First, the exponent for the first value, or a" print import time time.sleep(2) a = int(raw_input('Enter a: ')) print import time time.sleep(2) print "Second, the exponent for the entire equation, or c!" print import time time.sleep(2) c = int(raw_input('Enter c: ')) print import time time.sleep(2) print "Does your equation have a x value after the z value?" print import time time.sleep(2) a_power = a - 1 c_power = c - 1 power_y = a * y b_yes_no = int(raw_input("If your equation does not have an x value after z, type 1. If a x value is present in your equation, type any other number. Your answer: ")) if b_yes_no == 1: derived_function = str(c) + "( " + str(power_y) + x + str(a_power) + " + " + str(z)+ " )" + "( " + str(y) + x + str(a) + " + " + str(z) + " )" + "^" + str(c_power) print import time time.sleep(2) print "The derivative of your polynomial function is " + derived_function print import time time.sleep(2) print "Would you like to plug in an x-value?" print import time time.sleep(1) plug_in = int(raw_input('Enter 1 for yes, and any other number for no: ')) if plug_in == 1: print import time time.sleep(1) x = int(raw_input("Enter x value: ")) derived_function_answer = int(c) * ( (int(power_y) * (int(x) ** int(a_power))) + int(z)) * (((int(y) * (int(x) ** int(a))) + int(z))) ** int(c_power) import time time.sleep(1) print print str(derived_function_answer) + " is the answer to your polynomial derivative!" print import time time.sleep(3) print "Have a marvelous day!" else: print import time time.sleep(3) print "Have a marvelous day!" else: print import time time.sleep(2) b = int(raw_input('Enter b: ')) b_power = b - 1 power_z = b * z derived_function = str(c) + "( " + str(power_y) + x + str(a_power) + " + " + str(power_z) + x + str(b_power) + " )" + "( " + str(y) + x + str(a) + " + " + str(z) + x + str(b) + " )" + "^" + str(c_power) print import time time.sleep(2) print "The derivative of your polynomial function is " + derived_function print import time time.sleep(2) print "Would you like to plug in an x-value?" print import time time.sleep(1) plug_in = int(raw_input('Enter 1 for yes, and any other number for no: ')) if plug_in == 1: print import time time.sleep(1) x = int(raw_input("Enter x value: ")) import time time.sleep(1) print derived_function_answer = int(c) * ( (int(power_y) * (int(x) ** int(a_power))) + (int(power_z) * (int(x) ** int(b_power)))) * (((int(y) * (int(x) ** int(a))) + int(z) * (int(x) ** int(b))) ** int(c_power)) print str(derived_function_answer) + " is the answer to your polynomial derivative!" print import time time.sleep(3) print "Have a marvelous day!" else: print import time time.sleep(3) print "Have a marvelous day!"
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question