Question

In: Computer Science

PYTHON 1. Write a program that takes the first derivative of f(x) = 3x2 + 20x...

PYTHON

1. Write a program that takes the first derivative of f(x) = 3x2 + 20x + 5 and prints the values of this derivative at x= -5; x= +5 and x = +10       

2. Write a program that takes the 2nd derivative of x5 and prints its value when x = 10.

3.  Write a program that generates 5 random integers between 1 and 75 inclusive ad prints the 5 integers, one per line.

Solutions

Expert Solution

Thanks for the question. Below is the code you will be needing. Let me know if you have any doubts or if you need anything to change. 

If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions.

Thank You!
===========================================================================



# 1. Write a program that takes the first derivative of
# f(x) = 3x2 + 20x + 5 and prints the values of this
# derivative at x= -5; x= +5 and x = +10

x_values = (-5, 5, 10)
for x in x_values:
    derivative = 6 * x + 20
    print('Derivative of 3x2 + 20x + 5 at x={} is: {}'.format(x, derivative))

# 2. Write a program that takes the 2nd derivative of x5 and prints its value when x = 10.
x = 10
derivative = 20 * x * x * x
print('2nd derivative of x5 at x ={} is: {}'.format(x, derivative))

# 3.  Write a program that generates 5 random integers
# between 1 and 75 inclusive ad prints the 5 integers, one per line.

import random

for num in range(1, 6):
    random_number = random.randint(1, 75)
    print('Random #{}: {}'.format(num, random_number))


Related Solutions

Let f(x) = −3+(3x2 −x+1) ln(2√x−5) (a) Find the derivative of f. (b) Using the derivative...
Let f(x) = −3+(3x2 −x+1) ln(2√x−5) (a) Find the derivative of f. (b) Using the derivative and linear approximation, estimate f(9.1).
Question 1 Let f be a function for which the first derivative is f ' (x)...
Question 1 Let f be a function for which the first derivative is f ' (x) = 2x 2 - 5 / x2 for x > 0, f(1) = 7 and f(5) = 11. Show work for all question. a). Show that f satisfies the hypotheses of the Mean Value Theorem on [1, 5] b)Find the value(s) of c on (1, 5) that satisfyies the conclusion of the Mean Value Theorem. Question 2 Let f(x) = x 3 − 3x...
Compute the derivative of each function a.) f(x)= x5/2 - 3x2/3 b.) f(x) = 3x- log7x+7...
Compute the derivative of each function a.) f(x)= x5/2 - 3x2/3 b.) f(x) = 3x- log7x+7 c.) f(x)= 8x6-5x3+3x2-11x+7
Write a program in Python that - Takes in a gross salary. - If the gross...
Write a program in Python that - Takes in a gross salary. - If the gross salary is above €50.000 taxes are 50%. - If the gross salary is above €25.000 taxes are 25%. - If the gross salary is above €10.000 taxes are 10%. - If the gross salary is below €10.000 there is no tax. - Output the gross salary and the net income. Note: Give the pseudocode of your program.
Use the given function, its first derivative, and its second derivative to answer the following: f(x)=(1/3)x^3...
Use the given function, its first derivative, and its second derivative to answer the following: f(x)=(1/3)x^3 - (1/2)x^2 - 6x + 5 f'(x)= x^2 - x - 6 = (x+2)(x-3) f''(x)= 2x - 1 a) What are the intervals of increase and the intervals of decrease b) Identify local min and max points c) What are the intervals where the function is concave up, concave down and identify the inflection points
f(x), find the derivative (f^-1)'(c) at the given point c, first finding a=f^-1(c) 1. f(x)=5x+9x^21. c=-14...
f(x), find the derivative (f^-1)'(c) at the given point c, first finding a=f^-1(c) 1. f(x)=5x+9x^21. c=-14 a=? (f^-1)'(c)= ?
IN PYTHON Write a program that takes in a positive integer as input, and outputs a...
IN PYTHON Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x // 2 Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string....
first and second derivative of f(x)= (1-x)arctan(2x) also find newtons method formula
first and second derivative of f(x)= (1-x)arctan(2x) also find newtons method formula
Using python: Given a string x, write a program to check if its first character is...
Using python: Given a string x, write a program to check if its first character is the same as its last character. If yes, the code should output "True"
Find the local maximum and minimum values of f using the First Derivative Test. f(x) =...
Find the local maximum and minimum values of f using the First Derivative Test. f(x) = x2 x − 2 local maximum value     local minimum value
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT