Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Zubair Tariq (BCS c)

Major Assignment on the Function of


several variables
Q1.Give real life applications (at least four) of function several (two, three,
etc) variables with mathematical justification.

1. A function to calculate the batting average of a batsman. The function will consist of two
variables Total runs scored (T) and Number of times he gets out (O).
So it will,
F(t,o) = T/O
If a batsman scores T= 660 runs and gets out O= 5 times
The average will = 132avg

2. Function to calculate profit and loss. Consists of two variable cost price (c) and selling price (s).
So it will be,
F(c,s)= s-c
if the final product is > than Cost price it will be gain if < than loss.
If we have selling price S = 45 and Cost price C = 40
Then we’ll have a gain of 5rs.

3. Function to calculate area of a rectangle. We’ll have two variables a it depends on length (l) and
width (w) of the rectangle.
So it will be,
f(l,w)= l x b

If we have a rectangle and its length (l) = 45 and width = 20


Its area will be = 900m2
Q2. Define function of one, two and three variables. Then generalized the
definition for n variables’. Give few example of each mathematically.

Function of one variable: A function f x is a rule which assign to each x ∈ X a


unique y ∈ Y. X is called independent variable while y is called dependent variable. Set x is
domain and set y is the range set.

Example: f(x) = 1/x,

f(x) = x+2

Function of two variable: A function f D ⊆ ℝ + ℝ  ℝ is a rule which assign to each


ordered pair (x, y) ∈ D a unique Z ∈ ℝ.

Example: Z= f(x,y),

f(x,y) = 1/ x*y

Function of three variable: A function f: D ⊆ ℝ → ℝ is a rule which assign to each


3

(x, y, z) ∈ D a unique Z ∈ ℝ.

Example: f(x,y,z) = √ x 2+ y 2 + z 2

Function of N variable: A function f: D ⊆ ℝ → ℝ is a rule which assign to each


N

(x1, x2, x3,………Xn) ∈ D a unique S ∈ ℝ.

Example: S = F(x1,x2,x3…….xn)

N = set of natural numbers


Q3. Find the domain and range of each question in Ex. 14.1 Q1-12 in
Thomas Calculus book. Plot the domain graphically.
GRAPHS

Q1
Q2

Q3

IT’S A 3D GRAPH. NOT POSSIBLE TO DRAW

Q4

IT’S A 3D GRAPH. NOT POSSIBLE TO DRAW

Q5
Q6
Q7

Q8

Q9 AND Q12
Q4. Write the algorithm for the domain of Functions in Q5 to Q12. Code
the algorithims in any Software Language.

import math

print("Question no.5 in Ex:14.1 of the book.\n"
      "f(x,y)= √(y-x-2)\n"
      "Domain = {(x,y)∈R|y≥ x+2}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if y >= x+2:
    a = (y-x-2)
    z = math.sqrt(a)
    print("The output of the function is: ",z)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#--------------------------------------

print("Question no.6 in Ex:14.1 of the book.\n"
      "f(x,y)=ln⁡(x^2+y^2-4)\n"
      "Domain = {(x,y)∈ R^2 | x^2+y^2>4}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if (x^2 + y^2) > 4:
    a = x^2 + y^2 - 4
    z = math.log(z)
    print("The output of the function is: ",z)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#---------------------------------------

print("Question no.7 in Ex:14.1 of the book.\n"
      " f(x,y)=((x-1)(y+2))/((y-x)(y-x^3))\n"
      "Domain = {(x,y)∈ R^2 ┤|y≠x,y≠x^3}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if x != y and y != x^3:
    a = ((x-1)*(y+2))/((y-x)*(y-x^3))
    print("The output of the function is: ",a)
else:
    print("The values you entered is not in the range.\nPlease input again.")
    
#---------------------------------------

print("Question no.8 in Ex:14.1 of the book.\n"
      "f(x,y)=(sin⁡(xy))/(x^2+y^2-25)\n"
      "Domain = {(x,y)∈ R^2 ┤| x^2+y^2≠25}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if (x*2 + y^2) != 25:
    p = x*y
    a = math.sin(p)/(x^2 + Y^2 - 25)
    print("The output of the function is: ",a)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#--------------------------------------

print("Question no.9 in Ex:14.1 of the book.\n"
      " f(x,y)=〖cos〗^(-1)⁡〖(y-x^2)〗\n"
      "Domain = {(x,y)∈ R^2 |x^2-1≤y≤x^2+1}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if y >= (x^2 - 1) and y <= (x^2 + 1):
    p = y - x^2
    a = math.acos(p)
    print("The output of the function is: ",a)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#--------------------------------------
print("Question no.10 in Ex:14.1 of the book.\n"
      " f(x,y)=ln⁡(xy+x-y-1)\n"
      "Domain = {(x,y)∈R^2 |(xy+x-y-1)>0}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if ((y+1)*(x-1)) > 0:
    p = (x*y) + x - y - 1
    a = math.log(p)
    print("The output of the function is: ",a)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#--------------------------------------

print("Question no.11 in Ex:14.1 of the book.\n"
      " f(x,y)= √((x^2-4)(y^2-9))\n"
      "Domain = {(x,y)∈R^2 |〖(x〗^2-4)(y^2-9)≥0}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if ((x^2 - 4)*(y^2 - 9)) >= 0:
    p = ((x^2 - 4)*(y^2 - 9))
    a = math.sqrt(p)
    print("The output of the function is: ",a)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#--------------------------------------

print("Question no.12 in Ex:14.1 of the book.\n"
      " f(x,y)=1/(ln(4-x^2-y^2))\n"
      "Domain = {(x,y)∈R^2│x^2+y^2<4,x^2+y^2≠3}")

x = int(input("Enter value for x: "))
y = int(input("Enter value for y: "))

if (x^2 + y^2) < 4 and (x^2 + y^2) != 3:
    p = (4 - x^2 - y^2)
    a = 1 / math.log(p)
    print("The output of the function is: ",a)
else:
    print("The values you entered is not in the range.\nPlease input again.")

#--------------------------------------

You might also like