- Awards Season
- Big Stories
- Pop Culture
- Video Games
- Celebrities

Sudoku for Beginners: How to Improve Your Problem-Solving Skills
Are you a beginner when it comes to solving Sudoku puzzles? Do you find yourself frustrated and unsure of where to start? Fear not, as we have compiled a comprehensive guide on how to improve your problem-solving skills through Sudoku.
Understanding the Basics of Sudoku
Before we dive into the strategies and techniques, let’s first understand the basics of Sudoku. A Sudoku puzzle is a 9×9 grid that is divided into nine smaller 3×3 grids. The objective is to fill in each row, column, and smaller grid with numbers 1-9 without repeating any numbers.
Starting Strategies for Beginners
As a beginner, it can be overwhelming to look at an empty Sudoku grid. But don’t worry. There are simple starting strategies that can help you get started. First, look for any rows or columns that only have one missing number. Fill in that number and move on to the next row or column with only one missing number. Another strategy is looking for any smaller grids with only one missing number and filling in that number.
Advanced Strategies for Beginner/Intermediate Level
Once you’ve mastered the starting strategies, it’s time to move on to more advanced techniques. One technique is called “pencil marking.” This involves writing down all possible numbers in each empty square before making any moves. Then use logic and elimination techniques to cross off impossible numbers until you are left with the correct answer.
Another advanced technique is “hidden pairs.” Look for two squares within a row or column that only have two possible numbers left. If those two possible numbers exist in both squares, then those two squares must contain those specific numbers.
Benefits of Solving Sudoku Puzzles
Not only is solving Sudoku puzzles fun and challenging, but it also has many benefits for your brain health. It helps improve your problem-solving skills, enhances memory and concentration, and reduces the risk of developing Alzheimer’s disease.
In conclusion, Sudoku is a great way to improve your problem-solving skills while also providing entertainment. With these starting and advanced strategies, you’ll be able to solve even the toughest Sudoku puzzles. So grab a pencil and paper and start sharpening those brain muscles.
This text was generated using a large language model, and select text has been reviewed and moderated for purposes such as readability.
MORE FROM ASK.COM


Find Study Materials for
Business studies, combined science, computer science, english literature, environmental science, human geography, macroeconomics, microeconomics.
- Social Studies
- Browse all subjects
- Exam Revision
- Career Advice for Students
- Student Life
- Study Guide
- University Advice
- Read our Magazine
Create Study Materials
Select your language.

The primary idea in the business world is to maximize profit. However, it's not as simple as trying to sell as many products as possible. Other factors and costs go into a business, such as employee salaries, cost of production, cost of materials, and price of advertisement. Often, the answer to maximizing profit is not simply producing and selling as many products…

Explore our app and discover over 50 million learning materials for free.
- Optimization Problems
- Explanations
- StudySmarter AI
- Textbook Solutions
- Absolute Maxima and Minima
- Absolute and Conditional Convergence
- Accumulation Function
- Accumulation Problems
- Algebraic Functions
- Alternating Series
- Antiderivatives
- Application of Derivatives
- Approximating Areas
- Arc Length of a Curve
- Area Between Two Curves
- Arithmetic Series
- Average Value of a Function
- Calculus of Parametric Curves
- Candidate Test
- Combining Differentiation Rules
- Combining Functions
- Continuity Over an Interval
- Convergence Tests
- Cost and Revenue
- Density and Center of Mass
- Derivative Functions
- Derivative of Exponential Function
- Derivative of Inverse Function
- Derivative of Logarithmic Functions
- Derivative of Trigonometric Functions
- Derivatives
- Derivatives and Continuity
- Derivatives and the Shape of a Graph
- Derivatives of Inverse Trigonometric Functions
- Derivatives of Polar Functions
- Derivatives of Sec, Csc and Cot
- Derivatives of Sin, Cos and Tan
- Determining Volumes by Slicing
- Direction Fields
- Disk Method
- Divergence Test
- Eliminating the Parameter
- Euler's Method
- Evaluating a Definite Integral
- Evaluation Theorem
- Exponential Functions
- Finding Limits
- Finding Limits of Specific Functions
First Derivative Test
- Function Transformations
- General Solution of Differential Equation
- Geometric Series
- Growth Rate of Functions
- Higher-Order Derivatives
- Hydrostatic Pressure
- Hyperbolic Functions
- Implicit Differentiation Tangent Line
- Implicit Relations
- Improper Integrals
- Indefinite Integral
- Indeterminate Forms
- Initial Value Problem Differential Equations
- Integral Test
- Integrals of Exponential Functions
- Integrals of Motion
- Integrating Even and Odd Functions
- Integration Formula
- Integration Tables
- Integration Using Long Division
- Integration of Logarithmic Functions
- Integration using Inverse Trigonometric Functions
- Intermediate Value Theorem
- Inverse Trigonometric Functions
- Jump Discontinuity
- Lagrange Error Bound
- Limit of Vector Valued Function
- Limit of a Sequence
- Limits at Infinity
- Limits at Infinity and Asymptotes
- Limits of a Function
- Linear Approximations and Differentials
- Linear Differential Equation
- Linear Functions
- Logarithmic Differentiation
- Logarithmic Functions
- Logistic Differential Equation
- Maclaurin Series
- Manipulating Functions
- Maxima and Minima
- Maxima and Minima Problems
- Mean Value Theorem for Integrals
- Models for Population Growth
- Motion Along a Line
- Motion in Space
- Natural Logarithmic Function
- Net Change Theorem
- Newton's Method
- Nonhomogeneous Differential Equation
- One-Sided Limits
- Particle Model Motion
- Particular Solutions to Differential Equations
- Polar Coordinates
- Polar Coordinates Functions
- Polar Curves
- Population Change
- Power Series
- Radius of Convergence
- Related Rates
- Removable Discontinuity
- Riemann Sum
- Rolle's Theorem
- Second Derivative Test
- Separable Equations
- Separation of Variables
- Simpson's Rule
- Solid of Revolution
- Solutions to Differential Equations
- Surface Area of Revolution
- Symmetry of Functions
- Tangent Lines
- Taylor Polynomials
- Taylor Series
- Techniques of Integration
- The Fundamental Theorem of Calculus
- The Mean Value Theorem
- The Power Rule
- The Squeeze Theorem
- The Trapezoidal Rule
- Theorems of Continuity
- Trigonometric Substitution
- Vector Valued Function
- Vectors in Calculus
- Vectors in Space
- Washer Method
- Algorithmic Recurrence Relations
- Algorithms on Graphs
- Allocation Problems
- Bin-packing Algorithms
- Constructing Cayley Tables
- Critical Path Analysis
- Decision Analysis
- Dijkstra's Algorithm
- Dynamic Programming
- Eulerian graphs
- Flow Charts
- Floyd's Algorithm
- Formulating Linear Programming Problems
- Gantt Charts
- Graph Theory
- Group Generators
- Group Theory Terminology
- Kruskal's Algorithm
- Linear Programming
- Prim's Algorithm
- Simplex Algorithm
- The Minimum Spanning Tree Method
- The North-West Corner Method
- The Simplex Method
- The Travelling Salesman Problem
- Using a Dummy
- 2 Dimensional Figures
- 3 Dimensional Vectors
- 3-Dimensional Figures
- Angles in Circles
- Arc Measures
- Area and Volume
- Area of Circles
- Area of Circular Sector
- Area of Parallelograms
- Area of Plane Figures
- Area of Rectangles
- Area of Regular Polygons
- Area of Rhombus
- Area of Trapezoid
- Area of a Kite
- Composition
- Congruence Transformations
- Congruent Triangles
- Convexity in Polygons
- Coordinate Systems
- Distance and Midpoints
- Equation of Circles
- Equilateral Triangles
- Fundamentals of Geometry
- Geometric Inequalities
- Geometric Mean
- Geometric Probability
- Glide Reflections
- HL ASA and AAS
- Identity Map
- Inscribed Angles
- Isosceles Triangles
- Law of Cosines
- Law of Sines
- Linear Measure and Precision
- Parallel Lines Theorem
- Parallelograms
- Perpendicular Bisector
- Plane Geometry
- Projections
- Properties of Chords
- Proportionality Theorems
- Pythagoras Theorem
- Reflection in Geometry
- Regular Polygon
- Right Triangles
- SSS and SAS
- Segment Length
- Similarity Transformations
- Special quadrilaterals
- Surface Area of Cone
- Surface Area of Cylinder
- Surface Area of Prism
- Surface Area of Sphere
- Surface Area of a Solid
- Surface of Pyramids
- Translations
- Triangle Inequalities
- Using Similar Polygons
- Vector Addition
- Vector Product
- Volume of Cone
- Volume of Cylinder
- Volume of Pyramid
- Volume of Solid
- Volume of Sphere
- Volume of prisms
- Acceleration and Time
- Acceleration and Velocity
- Angular Speed
- Assumptions
- Calculus Kinematics
- Coefficient of Friction
- Connected Particles
- Conservation of Mechanical Energy
- Constant Acceleration
- Constant Acceleration Equations
- Converting Units
- Damped harmonic oscillator
- Direct Impact and Newton's Law of Restitution
- Elastic Energy
- Elastic Strings and Springs
- Force as a Vector
- Newton's First Law
- Newton's Law of Gravitation
- Newton's Second Law
- Newton's Third Law
- Problems involving Relative Velocity
- Projectiles
- Relative Motion
- Resolving Forces
- Rigid Bodies in Equilibrium
- Statics and Dynamics
- Tension in Strings
- The Trajectory of a Projectile
- Variable Acceleration
- Vertical Oscillation
- Work Done by a Constant Force
- Basic Probability
- Charts and Diagrams
- Continuous and Discrete Data
- Frequency, Frequency Tables and Levels of Measurement
- Independent Events Probability
- Line Graphs
- Mean Median and Mode
- Mutually Exclusive Probabilities
- Probability Rules
- Probability of Combined Events
- Quartiles and Interquartile Range
- Systematic Listing
- ASA Theorem
- Absolute Value Equations and Inequalities
- Addition and Subtraction of Rational Expressions
- Addition, Subtraction, Multiplication and Division
- Algebraic Fractions
- Algebraic Notation
- Algebraic Representation
- Analyzing Graphs of Polynomials
- Angle Measure
- Angles in Polygons
- Approximation and Estimation
- Area and Perimeter of Quadrilaterals
- Area of Triangles
- Argand Diagram
- Arithmetic Sequences
- Average Rate of Change
- Bijective Functions
- Binomial Expansion
- Binomial Theorem
- Cayley Hamilton Theorem
- Circle Theorems
- Circles Maths
- Combinatorics
- Common Factors
- Common Multiples
- Completing the Square
- Complex Numbers
- Composite Functions
- Composition of Functions
- Compound Interest
- Compound Units
- Congruence Equations
- Conic Sections
- Construction and Loci
- Converting Metrics
- Convexity and Concavity
- Coordinate Geometry
- Coordinates in Four Quadrants
- Coupled First-order Differential Equations
- Cubic Function Graph
- Data transformations
- De Moivre's Theorem
- Deductive Reasoning
- Definite Integrals
- Deriving Equations
- Determinant of Inverse Matrix
- Determinants
- Diagonalising Matrix
- Differential Equations
- Differentiation
- Differentiation Rules
- Differentiation from First Principles
- Differentiation of Hyperbolic Functions
- Direct and Inverse proportions
- Disjoint and Overlapping Events
- Disproof by Counterexample
- Distance from a Point to a Line
- Divisibility Tests
- Double Angle and Half Angle Formulas
- Drawing Conclusions from Examples
- Eigenvalues and Eigenvectors
- Equation of Line in 3D
- Equation of a Perpendicular Bisector
- Equation of a circle
- Equations and Identities
- Equations and Inequalities
- Estimation in Real Life
- Euclidean Algorithm
- Evaluating and Graphing Polynomials
- Even Functions
- Exponential Form of Complex Numbers
- Exponential Rules
- Exponentials and Logarithms
- Expression Math
- Expressions and Formulas
- Faces Edges and Vertices
- Factoring Polynomials
- Factoring Quadratic Equations
- Factorising expressions
- Fermat's Little Theorem
- Finding Maxima and Minima Using Derivatives
- Finding Rational Zeros
- Finding the Area
- First-order Differential Equations
- Forms of Quadratic Functions
- Fractional Powers
- Fractional Ratio
- Fractions and Decimals
- Fractions and Factors
- Fractions in Expressions and Equations
- Fractions, Decimals and Percentages
- Function Basics
- Functional Analysis
- Fundamental Counting Principle
- Fundamental Theorem of Algebra
- Generating Terms of a Sequence
- Geometric Sequence
- Gradient and Intercept
- Graphical Representation
- Graphing Rational Functions
- Graphing Trigonometric Functions
- Graphs and Differentiation
- Graphs of Common Functions
- Graphs of Exponents and Logarithms
- Graphs of Trigonometric Functions
- Greatest Common Divisor
- Group Mathematics
- Growth and Decay
- Growth of Functions
- Harmonic Motion
- Highest Common Factor
- Imaginary Unit and Polar Bijection
- Implicit differentiation
- Inductive Reasoning
- Inequalities Maths
- Infinite geometric series
- Injective functions
- Instantaneous Rate of Change
- Integrating Polynomials
- Integrating Trigonometric Functions
- Integrating e^x and 1/x
- Integration
- Integration Using Partial Fractions
- Integration by Parts
- Integration by Substitution
- Integration of Hyperbolic Functions
- Invariant Points
- Inverse Hyperbolic Functions
- Inverse Matrices
- Inverse and Joint Variation
- Inverse functions
- Iterative Methods
- L'Hopital's Rule
- Law of Cosines in Algebra
- Law of Sines in Algebra
- Laws of Logs
- Leibnitz's Theorem
- Limits of Accuracy
- Linear Expressions
- Linear Systems
- Linear Transformations of Matrices
- Location of Roots
- Logarithm Base
- Lower and Upper Bounds
- Lowest Common Denominator
- Lowest Common Multiple
- Math formula
- Matrix Addition and Subtraction
- Matrix Calculations
- Matrix Determinant
- Matrix Multiplication
- Metric and Imperial Units
- Misleading Graphs
- Mixed Expressions
- Modelling with First-order Differential Equations
- Modular Arithmetic
- Modulus Functions
- Modulus and Phase
- Multiples of Pi
- Multiplication and Division of Fractions
- Multiplicative Relationship
- Multiplying and Dividing Rational Expressions
- Natural Logarithm
- Natural Numbers
- Number Line
- Number Systems
- Number Theory
- Numerical Methods
- Odd functions
- Open Sentences and Identities
- Operation with Complex Numbers
- Operations with Decimals
- Operations with Matrices
- Operations with Polynomials
- Order of Operations
- Parallel Lines
- Parametric Differentiation
- Parametric Equations
- Parametric Hyperbolas
- Parametric Integration
- Parametric Parabolas
- Partial Fractions
- Pascal's Triangle
- Percentage Increase and Decrease
- Perimeter of a Triangle
- Permutations and Combinations
- Perpendicular Lines
- Points Lines and Planes
- Polynomial Graphs
- Polynomials
- Powers Roots And Radicals
- Powers and Exponents
- Powers and Roots
- Prime Factorization
- Prime Numbers
- Problem-solving Models and Strategies
- Product Rule
- Proof and Mathematical Induction
- Proof by Contradiction
- Proof by Deduction
- Proof by Exhaustion
- Proof by Induction
- Properties of Exponents
- Proving an Identity
- Pythagorean Identities
- Quadratic Equations
- Quadratic Function Graphs
- Quadratic Graphs
- Quadratic functions
- Quadrilaterals
- Quotient Rule
- Radical Functions
- Rates of Change
- Ratio Fractions
- Rational Exponents
- Rational Expressions
- Rational Functions
- Rational Numbers and Fractions
- Ratios as Fractions
- Real Numbers
- Reciprocal Graphs
- Recurrence Relation
- Recursion and Special Sequences
- Reducible Differential Equations
- Remainder and Factor Theorems
- Representation of Complex Numbers
- Rewriting Formulas and Equations
- Roots of Complex Numbers
- Roots of Polynomials
- Roots of Unity
- SAS Theorem
- SSS Theorem
- Scalar Products
- Scalar Triple Product
- Scale Drawings and Maps
- Scale Factors
- Scientific Notation
- Second Order Recurrence Relation
- Second-order Differential Equations
- Sector of a Circle
- Segment of a Circle
- Sequences and Series
- Series Maths
- Similar Triangles
- Similar and Congruent Shapes
- Simple Interest
- Simplifying Fractions
- Simplifying Radicals
- Simultaneous Equations
- Sine and Cosine Rules
- Small Angle Approximation
- Solving Linear Equations
- Solving Linear Systems
- Solving Quadratic Equations
- Solving Radical Inequalities
- Solving Rational Equations
- Solving Simultaneous Equations Using Matrices
- Solving Systems of Inequalities
- Solving Trigonometric Equations
- Solving and Graphing Quadratic Equations
- Solving and Graphing Quadratic Inequalities
- Special Products
- Standard Form
- Standard Integrals
- Standard Unit
- Straight Line Graphs
- Substraction and addition of fractions
- Sum and Difference of Angles Formulas
- Sum of Natural Numbers
- Surjective functions
- Tables and Graphs
- Tangent of a Circle
- The Quadratic Formula and the Discriminant
- Transformations
- Transformations of Graphs
- Transformations of Roots
- Translations of Trigonometric Functions
- Triangle Rules
- Triangle trigonometry
- Trigonometric Functions
- Trigonometric Functions of General Angles
- Trigonometric Identities
- Trigonometric Ratios
- Trigonometry
- Turning Points
- Types of Functions
- Types of Numbers
- Types of Triangles
- Unit Circle
- Variables in Algebra
- Verifying Trigonometric Identities
- Volumes of Revolution
- Writing Equations
- Writing Linear Equations
- Bias in Experiments
- Binomial Distribution
- Binomial Hypothesis Test
- Bivariate Data
- Categorical Variables
- Central Limit Theorem
- Chi Square Test for Goodness of Fit
- Chi Square Test for Homogeneity
- Chi Square Test for Independence
- Chi-Square Distribution
- Combining Random Variables
- Comparing Data
- Comparing Two Means Hypothesis Testing
- Conditional Probability
- Conducting a Study
- Conducting a Survey
- Conducting an Experiment
- Confidence Interval for Population Mean
- Confidence Interval for Population Proportion
- Confidence Interval for Slope of Regression Line
- Confidence Interval for the Difference of Two Means
- Confidence Intervals
- Correlation Math
- Cumulative Distribution Function
- Cumulative Frequency
- Data Analysis
- Data Interpretation
- Degrees of Freedom
- Discrete Random Variable
- Distributions
- Empirical Rule
- Errors in Hypothesis Testing
- Estimator Bias
- Events (Probability)
- Frequency Polygons
- Generalization and Conclusions
- Geometric Distribution
- Hypothesis Test for Correlation
- Hypothesis Test for Regression Slope
- Hypothesis Test of Two Population Proportions
- Hypothesis Testing
- Inference for Distributions of Categorical Data
- Inferences in Statistics
- Large Data Set
- Least Squares Linear Regression
- Linear Interpolation
- Linear Regression
- Mean and Variance of Poisson Distributions
- Measures of Central Tendency
- Methods of Data Collection
- Normal Distribution
- Normal Distribution Hypothesis Test
- Normal Distribution Percentile
- Paired T-Test
- Point Estimation
- Probability
- Probability Calculations
- Probability Density Function
- Probability Distribution
- Probability Generating Function
- Product Moment Correlation Coefficient
- Quantitative Variables
- Random Variables
- Randomized Block Design
- Residual Sum of Squares
- Sample Mean
- Sample Proportion
- Sampling Distribution
- Scatter Graphs
- Single Variable Data
- Spearman's Rank Correlation Coefficient
- Standard Deviation
- Standard Error
- Standard Normal Distribution
- Statistical Graphs
- Statistical Measures
- Stem and Leaf Graph
- Sum of Independent Random Variables
- Survey Bias
- T-distribution
- The Power Function
- Transforming Random Variables
- Tree Diagram
- Two Categorical Variables
- Two Quantitative Variables
- Type I Error
- Type II Error
- Types of Data in Statistics
- Variance for Binomial Distribution
- Venn Diagrams
Save the explanation now and read when you’ve got time to spare.
Lerne mit deinen Freunden und bleibe auf dem richtigen Kurs mit deinen persönlichen Lernstatistiken
Nie wieder prokastinieren mit unseren Lernerinnerungen.
The primary idea in the business world is to maximize profit. However, it's not as simple as trying to sell as many products as possible. Other factors and costs go into a business, such as employee salaries, cost of production, cost of materials, and price of advertisement. Often, the answer to maximizing profit is not simply producing and selling as many products as possible.
Mathematical optimization can help find the answer that maximizes profit subject to the constraints of the real world. Optimization is one of the most interesting real-world applications of Calculus . This article will further define optimization, its other applications, and a method for solving simple optimization problems.
For a focus on business and economic-type optimization problems, see our article on Applications to Business and Economics
Optimization Problems Meaning
Mathematical optimization is the study of maximizing or minimizing a function subject to constraints, essentially finding the most effective and functional solution to a problem.
The constraints in optimization problems represent the limiting factors involved in the maximization/minimization problem. In our example of a business, the constraints would be the cost of labor, production, and advertisement. These constraints must be accounted for in our calculations as they can greatly influence the solution.
You've likely been learning and working through finding a function's extreme values (maximums and minimums). Optimization is a real-world application of finding and interpreting extreme values. Given an equation that models cost, we seek to find its minimum value, thus minimizing cost. Given an equation that models profits, we seek to find its maximum value, thus maximizing profit.
Applications and Types of Optimization Problems
In addition to the business application we've discussed, optimization is crucial in various other fields. Optimization can be as simple as a traveler seeking to minimize transportation time. We can also apply optimization in medicine, engineering, financial markets, rational decision-making and game theory, and packaging shipments.
Optimization is also heavily discussed in computer science. Program optimization, space and time optimization, and software optimization are crucial in writing and developing efficient code and software.
Optimization problems can be quite complex, considering all the constraints involved. Converting real-world problems into mathematical models is one of the greatest challenges. As you progress through higher-level math classes, you'll deal with more complex optimization problems with more constraints to consider. In Calculus , we'll start with smaller-scale problems with fewer constraints. However, the baseline procedure is similar for all optimization problems.
Method for Solving Optimization Problems in Calculus
Before we start working through optimization examples, we'll go through a general step-by-step method for working through these problems. Later on, we'll apply these steps as we work through real examples.
- Step 1: Fully understand the problem
Optimization problems tend to pack loads of information into a short problem. The first step to working through an optimization problem is to read the problem carefully, gathering information on the known and unknown quantities and other conditions and constraints. It may be helpful to highlight certain values within the problem.
- Step 2: Draw a diagram
To better visualize the problem, it might be helpful to draw a diagram, including labels of known values provided in the problem.
- Step 3: Introduce necessary variables
Carefully declare variable names for values that are being maximized or minimized and other unknown quantities.
- Step 4: Set up the problem by finding relationships within the problem
Use the known values and your declared variables to set up a function. You must set up your function in terms of these values and variables based on their relation to each other.
- Step 5: Find the absolute extrema
There are a couple of methods for finding absolute extrema in optimization problems.
The Closed Interval Method
If the domain of your function is a closed interval, the Closed Interval Method may be a good way to compute absolute extrema.
This method involves finding all critical values within the interval by setting f ' ( x ) = 0 and solving for x . Each critical point, as well as the endpoints of the interval, should be plugged in to f ( x ) . The absolute extrema are largest value and smallest value of f ( x ) at the critical points.
The First Derivative Test for Absolute Extrema Values states that for a critical point c of a function f on an interval:
if f ' ( x ) > 0 for all x < c and f ' ( x ) < 0 for all x > c , then f ( c ) is the absolute maximum value of f ( x )
if f ' ( x ) < 0 for all x < c and f ' ( x ) > 0 for all x > c , then f ( c ) is the absolute minimum value of f ( x )
In other words, if the function goes from increasing to decreasing, it is a maximum. If the function goes from decreasing to increasing, it is a minimum.
Constrained Optimization Problems Examples
Let's work through a common maximization problem.
You are tasked with enclosing a rectangular field with a fence. You are given 400 ft of fencing materials. However, there is a barn on one side of the field (thus, fencing is not required on one side of the rectangular field). What dimensions of the field will produce the largest area subject to the 400 ft of fencing materials?
We will solve this problem using the method outlined in the article.
Let's draw the important information out from the problem.
We need to fence three sides of a rectangular field such that the area of the field is maximized . However, we only have 400 ft of fencing material to use. Thus, the perimeter of the rectangle must be less than or equal to 400 ft.
Clearly, you don't have to be an artist to sketch a diagram of the problem!
Looking at the diagram above, we've already introduced some variables. We'll let the height of the rectangle be represented by h . We'll let the width of the rectangle be represented by w .
h = h e i g h t w = w i d t h
So, we can calculate area and perimeter as
A r e a = h × w P e r i m e t e r = h + 2 w
The fencing problem wants us to maximize area A , subject to the constraint that the perimeter P must be greater or less than 400 ft. Intuitively, we know that we should use all 400 ft of fencing to maximize the area.
So, our problem becomes:
m a x i m i z e A = h × w s u c h t h a t P = 400 = h + 2 w
Since we seek to maximize the area, we must write the area in terms of the perimeter to achieve one single equation. In this example, we will write the area equation in terms of width, A ( w ) .
First, let's solve for the height, h :
400 = h + 2 w h = 400 - 2 w
Now, plug into the area in terms of the width equation, A ( w )
A ( w ) = ( 400 - 2 w ) ( w ) = 400 w - 2 w 2
In this case, we solved for the variable h to write the area equation in terms of width. This is because solving for h does not yield a fractional answer, so it may be "easier" to work with for most students. It is entirely possible to solve for width and write the area equation in terms of height as well! Give it a try and see if you get the same answer!
Now that we have a single equation containing all of the information from the problem, we want to find the absolute maximum of A ( w ) . We can define an interval for w so we can use the Closed Interval Method.
For starters, we know that w cannot be smaller than 0. If we let h = 0 , according to our perimeter equation, we have
P = h + 2 w 400 = 2 w w = 200
This tells us that if h = 0 , the maximum width possible is 200. So our closed interval for w is [ 0 , 200 ] .
To apply the Closed Interval Method:
First, find the extrema of A ( w ) by taking the derivative and setting it equal to 0.
A ' ( w ) = 400 - 4 w 0 = 400 - 4 w 4 w = 400 w = 100
Second, plug in the critical values w = 0 , w = 100 , a n d w = 200 i n t o A ( w ) and identify the largest area.
A ( 0 ) = 400 ( 0 ) - 2 ( 0 2 ) = 0
A ( 100 ) = 400 ( 100 ) - 2 ( 100 2 ) = 20000
A ( 200 ) = 400 ( 200 ) - 2 ( 200 2 ) = 0
So, the largest value of A occurs at w = 100 where A = 20 , 000 f t 2 .
We can confirm this using the First Derivative Test.
Graphing A ' ( w ) ...
A ' ( w ) clearly only equals 0 at one point, w = 100 . For all c < 100 , A ' ( w ) is positive (above the x -axis). For all c > 100 , A ' ( w ) is negative (below the x -axis). So, by the First Derivative Test, w = 100 is the absolute maximum of A ( w ) .
Let's plug in w = 100 to our perimeter equation to find out what h should be.
400 = h + 2 ( 100 ) h = 200
Therefore, to maximize the area enclosed by the fence subject to our material constraints, we should use a rectangle with a width of 100 ft and a height of 200 ft.
Now, let's try a minimization problem.
You are tasked with building a can that holds 1 liter of liquid. To maximize profit, you must build the can such that the material used to build it is minimized. What is the minimum surface area of the can required?
Again, we will solve this problem using the method outlined in the article.
We need to build a can that holds 1 liter of liquid while minimizing the material used to build it. Essentially, this means we need to minimize the can's surface area.
With this diagram, we can better understand what the problem is asking us to do.
Looking at the diagram above, we've already introduced some variables. We'll let the radius of the cylindrical can be represented by r . We'll let the height of the cylinder be represented by h . So, the volume of the cylinder V is V = πr 2 h and the surface area of the cylinder A is A = 2 πrh + 2 πr 2 .
The can problem wants us to minimize the surface area A subject to the constraint that the can must hold at least 1 liter. Intuitively, we know that to minimize surface area, we should build a can that holds 1 liter of liquid. However, since we are looking for a length measurement for r and h , we should convert liters into cubic centimeters. Thus, we should build a can that holds 1,000 cm 3 of liquid.
m i n i m i z e A = 2 πrh + 2 πr 2 subject to V = 1000 = πr 2 h
Since we seek to minimize the surface area, we must write the area in terms of the volume to achieve one single equation.
First, let's solve for h :
1000 = πr 2 h h = 1000 πr 2
Now, plug into the area equation:
A = 2 πr 1000 πr 2 + 2 πr 2 A = 2000 r + 2 πr 2
Now that we have a single equation containing all the information from the problem, we want to find the absolute minimum of A .
We know that r > 0 . However, we do not have an upper bound for r .
First, we'll find the extrema of A by taking the derivative and setting it equal to 0.
A ' = 4 πr - 2000 r 2 0 = 4 πr - 2000 r 2
Graphing the derivative:
We can see A ' = 0 at one point. We can confirm that the point r = 5 . 4192608391249 is an absolute minimum for A by applying the First Derivative Test . Looking at the graph, For all c < 5 . 4192608391249 , A ' ( r ) is negative (below the x -axis). For all c > 5 . 4192608391249 , A ' ( w ) is positive (above the x -axis). So, by the First Derivative Test, r = 5 . 4192608391249 is the absolute maximum of A ( r ) .
Let's plug in r = 5 . 4192608391249 to our volume equation to find out with h should be.
1000 = π ( 5 . 4192608391249 ) 2 h h = 10 . 8385208518578
So, to build a can that holds at least 1 liter, the minimum surface area required is
A = 2 π ( 5 . 4192608391249 ) ( 10 . 8385208518578 ) + 2 π ( 5 . 4192608391249 ) 2 A = 553 . 58 c m 2
Optimization Problems - Key takeaways
- Optimization is a real-world application of finding and interpreting extreme values
- To find the absolute extrema, use either the Closed Interval Method or the First Derivative Test
Frequently Asked Questions about Optimization Problems
--> what is an optimization problem.
Optimization problems seek to maximize or minimize a function subject to constraints, essentially finding the most effective and functional solution to the problem.
--> What is an example of an optimization problem?
A real-world example of an optimization problem is the idea of maximizing profits and minimizing cost within a business.
--> What is the formula for solving optimization problems?
To solve an optimization problem, you must set up a function in terms of known values and variables. Then, find the extrema of the function by taking the derivative and evaluating.
--> What are the types of the optimization problems?
Optimization problems can be seen in a variety of fields including business, medicine, engineering, financial markets, rational decision making and game theory, packaging shipments, and computer science.
--> How do you determine if you are dealing with an optimization problem?
Optimization problems involve maximizing or minimizing certain quantities. To determine if a problem is an optimization problem, carefully read the problem and look for language that suggests maximizing or minimizing.
Final Optimization Problems Quiz
Optimization problems quiz - teste dein wissen.
What is mathematical optimization?
Show answer
Mathematical optimization is the study of maximizing or minimizing a function subject to constraints, essentially finding the most effective and functional solution to a problem
Show question
Think of an example of an optimization problem. What quantities are being maximized or minimized? What constraints may apply?
One example of an optimization problem is the desire to maximize profits in the business world. However, some constraints may apply such as the cost of labor, materials to build a product, the cost of advertisements...
What mathematical concept in Calculus does optimization rely on?
Finding absolute extrema
Absolute extrema can be found using...
The Closed Interval Method or the First Derivative Test
State the result of the First Derivative Test.
The First Derivative Test states that for a critical point c of a function f on an interval:
- if f'(x) > 0 for all x < c and f'(x) < 0 for all x > c , then f(c) is the absolute maximum value of f(x)
- if f'(x) < 0 for all x < c and f'(x) > 0 for all x < c , then f(c) is the absolute minimum value of f(x)
How is the Closed Interval Method applied in optimization problems?
- Define a domain
- Take the derivative of the function and set it equal to 0 to find local extrema
- Plug extrema found by setting the derivative equal to 0 and the end points in to the function
- The point that produces the largest value is the absolute maximum on the interval while the point that produces the smallest value is the absolute minimum on the interval
Let's say we're maximizing the area of a garden. Which equations might be important for this problem?
Area equation for the shape of the garden
Perimeter equation for the shape of the garden
Optimization problems typically ask you to ___________ or __________ some quantity.
Minimize or maximize
Think of some phrases that might signify the problem is asking you to find a maximum .
- "Find the largest..."
- "What dimensions will give the greatest..."
Think of some phrases that might signify the problem is asking you to find a minimum .
- "Find the minimum..."
- "What is the smallest..."
Just as you would do when solving for an extreme value, to solve an optimization problem, set the _____ derivative of your equation equal to _________.
It turns out, there are some business and economic problems that you can model and solve as optimization problems in calculus. These types of problems typically involve either:
Maximizing revenue.
Solving business/economic optimization problems almost __ requires you to find the marginal cost or marginal revenue, and occasionally both.
What is the definition of optimization?
Optimization is finding the maximum or minimum values of a given quantity, or finding when the maximums or minimums occur.
So, what quantities do you optimize in a business or economic problem?
In these cases, you are usually tasked with either:
maximizing revenue,
maximizing profits, or
minimizing costs.
True or False? The first couple of steps in any optimization problem (business, economic, or otherwise) are always the same.
What are the basic steps to solve optimization problems?
Identify the quantity you need to optimize.
Identify the feasible domain.
Find critical points.
Choose from \(3\) possible optimization methods:
The First Derivative Test
The Second Derivative Test
Once you have completed your optimization, there are \(2\) questions you must ask yourself:
Does my answer make sense?
Did I answer the correct question?
The cost function is defined as:
The cost function , \(C(x)\), is the cost of producing \(x\) units of a product.
The marginal cost function is defined as:
The marginal cost function , \(C'(x)\), is the rate of change of the cost with respect to the units of a product.
The demand function (also called the price function ) is defined as:
The demand function , \(p(x)\), is the price per unit that a company can charge if it sells \(x\) units of a product.
The revenue function is defined as:
The revenue function , \(R(x)\), is calculated by multiplying the number of units sold by the price at which they were sold,
\[ R(x) = x \cdot p(x). \]
The marginal revenue function is defined as:
The marginal revenue function, \(R'(x)\), is the rate of change of revenue with respect to the number of units sold,
\[ R'(x) = p(x) + x \cdot p'(x). \]
The profit function is defined as:
The profit functio n, \(P(x)\), is calculated by subtracting the cost from the revenue,
\[ P(x) = R(x) - C(x). \]
The marginal profit function is defined as:
The marginal profit function , \(P'(x)\), is the rate of change of profit with respect to number of units sold,
\[ P'(x) = R'(x) - C'(x). \]
What quantity do you need to optimize in the following example?
Given the revenue function (in dollars):
\[ R(x) = 900x^{\frac{2}{3}} - 60x \]
Find the number of units, \(x\), that maximizes the revenue. What is the maximum revenue?
- Optimize by maximizing it.
Given the cost function (in dollars):
\[ C(x) = 0.004x^{3} +20x + 1000 \]
What is the number of units, \(x\), that minimizes the average cost per unit, \( \bar{c}(x) \)?
The average cost per unit.
- Optimize by minimizing it.
Save explanations that you love in your personalised space, Access Anytime, Anywhere!
- Mechanics Maths
of the users don't pass the Optimization Problems quiz! Will you pass the quiz?
How would you like to learn this content?
94% of StudySmarter users achieve better grades.
Free math cheat sheet!
Everything you need to know on . A perfect summary so you can easily remember everything.
More explanations about Calculus
Discover the right content for your subjects, no need to cheat if you have everything you need to succeed packed into one app.
Be perfectly prepared on time with an individual plan.
Test your knowledge with gamified quizzes.
Create and find flashcards in record time.
Create beautiful notes faster than ever before.
Have all your study materials in one place.
Upload unlimited documents and save them online.
Study Analytics
Identify your study strength and weaknesses.
Weekly Goals
Set individual study goals and earn points reaching them.
Smart Reminders
Stop procrastinating with our study reminders.
Earn points, unlock badges and level up while studying.
Magic Marker
Create flashcards in notes completely automatically.
Smart Formatting
Create the most beautiful study materials using our templates.
Join millions of people in learning anywhere, anytime - every day
Sign up to highlight and take notes. It’s 100% free.
This is still free to read, it's not a paywall.
You need to register to keep reading, start learning with studysmarter, the only learning app you need..

Create a free account to save this explanation.
Save explanations to your personalised space and access them anytime, anywhere!
By signing up, you agree to the Terms and Conditions and the Privacy Policy of StudySmarter.
Already have an account? Log in
StudySmarter bietet alles, was du für deinen Lernerfolg brauchst - in einer App!
Privacy overview.
Collapse menu
Introduction, 1 analytic geometry.
- 2. Distance Between Two Points; Circles
- 3. Functions
- 4. Shifts and Dilations
2 Instantaneous Rate of Change: The Derivative
- 1. The slope of a function
- 2. An example
- 4. The Derivative Function
- 5. Properties of Functions
3 Rules for Finding Derivatives
- 1. The Power Rule
- 2. Linearity of the Derivative
- 3. The Product Rule
- 4. The Quotient Rule
- 5. The Chain Rule
4 Transcendental Functions
- 1. Trigonometric Functions
- 2. The Derivative of $\sin x$
- 3. A hard limit
- 4. The Derivative of $\sin x$, continued
- 5. Derivatives of the Trigonometric Functions
- 6. Exponential and Logarithmic functions
- 7. Derivatives of the exponential and logarithmic functions
- 8. Implicit Differentiation
- 9. Inverse Trigonometric Functions
- 10. Limits revisited
- 11. Hyperbolic Functions
5 Curve Sketching
- 1. Maxima and Minima
- 2. The first derivative test
- 3. The second derivative test
- 4. Concavity and inflection points
- 5. Asymptotes and Other Things to Look For
6 Applications of the Derivative
- 1. Optimization
- 2. Related Rates
- 3. Newton's Method
- 4. Linear Approximations
- 5. The Mean Value Theorem
7 Integration
- 1. Two examples
- 2. The Fundamental Theorem of Calculus
- 3. Some Properties of Integrals
8 Techniques of Integration
- 1. Substitution
- 2. Powers of sine and cosine
- 3. Trigonometric Substitutions
- 4. Integration by Parts
- 5. Rational Functions
- 6. Numerical Integration
- 7. Additional exercises
9 Applications of Integration
- 1. Area between curves
- 2. Distance, Velocity, Acceleration
- 4. Average value of a function
- 6. Center of Mass
- 7. Kinetic energy; improper integrals
- 8. Probability
- 9. Arc Length
- 10. Surface Area
10 Polar Coordinates, Parametric Equations
- 1. Polar Coordinates
- 2. Slopes in polar coordinates
- 3. Areas in polar coordinates
- 4. Parametric Equations
- 5. Calculus with Parametric Equations
11 Sequences and Series
- 1. Sequences
- 3. The Integral Test
- 4. Alternating Series
- 5. Comparison Tests
- 6. Absolute Convergence
- 7. The Ratio and Root Tests
- 8. Power Series
- 9. Calculus with Power Series
- 10. Taylor Series
- 11. Taylor's Theorem
- 12. Additional exercises
12 Three Dimensions
- 1. The Coordinate System
- 3. The Dot Product
- 4. The Cross Product
- 5. Lines and Planes
- 6. Other Coordinate Systems
13 Vector Functions
- 1. Space Curves
- 2. Calculus with vector functions
- 3. Arc length and curvature
- 4. Motion along a curve
14 Partial Differentiation
- 1. Functions of Several Variables
- 2. Limits and Continuity
- 3. Partial Differentiation
- 4. The Chain Rule
- 5. Directional Derivatives
- 6. Higher order derivatives
- 7. Maxima and minima
- 8. Lagrange Multipliers
15 Multiple Integration
- 1. Volume and Average Height
- 2. Double Integrals in Cylindrical Coordinates
- 3. Moment and Center of Mass
- 4. Surface Area
- 5. Triple Integrals
- 6. Cylindrical and Spherical Coordinates
- 7. Change of Variables
16 Vector Calculus
- 1. Vector Fields
- 2. Line Integrals
- 3. The Fundamental Theorem of Line Integrals
- 4. Green's Theorem
- 5. Divergence and Curl
- 6. Vector Functions for Surfaces
- 7. Surface Integrals
- 8. Stokes's Theorem
- 9. The Divergence Theorem
17 Differential Equations
- 1. First Order Differential Equations
- 2. First Order Homogeneous Linear Equations
- 3. First Order Linear Equations
- 4. Approximation
- 5. Second Order Homogeneous Equations
- 6. Second Order Linear Equations
- 7. Second Order Linear Equations, take two

18 Useful formulas
19 introduction to sage.
- 2. Differentiation
- 3. Integration
Many important applied problems involve finding the best way to accomplish some task. Often this involves finding the maximum or minimum value of some function: the minimum time to make a certain journey, the minimum cost for doing a task, the maximum power that can be generated by a device, and so on. Many of these problems can be solved by finding the appropriate function and then using techniques of calculus to find the maximum or the minimum value required.
Generally such a problem will have the following mathematical form: Find the largest (or smallest) value of $f(x)$ when $a\le x\le b$. Sometimes $a$ or $b$ are infinite, but frequently the real world imposes some constraint on the values that $x$ may have.
Such a problem differs in two ways from the local maximum and minimum problems we encountered when graphing functions: We are interested only in the function between $a$ and $b$, and we want to know the largest or smallest value that $f(x)$ takes on, not merely values that are the largest or smallest in a small interval. That is, we seek not a local maximum or minimum but a global maximum or minimum, sometimes also called an absolute maximum or minimum.
Any global maximum or minimum must of course be a local maximum or minimum. If we find all possible local extrema, then the global maximum, if it exists , must be the largest of the local maxima and the global minimum, if it exists , must be the smallest of the local minima. We already know where local extrema can occur: only at those points at which $f'(x)$ is zero or undefined. Actually, there are two additional points at which a maximum or minimum can occur if the endpoints $a$ and $b$ are not infinite, namely, at $a$ and $b$. We have not previously considered such points because we have not been interested in limiting a function to a small interval. An example should make this clear.
Example 6.1.1 Find the maximum and minimum values of $\ds f(x)=x^2$ on the interval $[-2,1]$, shown in figure 6.1.1 . We compute $\ds f'(x)=2x$, which is zero at $x=0$ and is always defined.
Since $f'(1)=2$ we would not normally flag $x=1$ as a point of interest, but it is clear from the graph that when $f(x)$ is restricted to $[-2,1]$ there is a local maximum at $x=1$. Likewise we would not normally pay attention to $x=-2$, but since we have truncated $f$ at $-2$ we have introduced a new local maximum there as well. In a technical sense nothing new is going on here: When we truncate $f$ we actually create a new function, let's call it $g$, that is defined only on the interval $[-2,1]$. If we try to compute the derivative of this new function we actually find that it does not have a derivative at $-2$ or $1$. Why? Because to compute the derivative at 1 we must compute the limit $$\lim_{\Delta x\to 0} {g(1+\Delta x)-g(1)\over \Delta x}.$$ This limit does not exist because when $\Delta x>0$, $g(1+\Delta x)$ is not defined. It is simpler, however, simply to remember that we must always check the endpoints.
So the function $g$, that is, $f$ restricted to $[-2,1]$, has one critical value and two finite endpoints, any of which might be the global maximum or minimum. We could first determine which of these are local maximum or minimum points (or neither); then the largest local maximum must be the global maximum and the smallest local minimum must be the global minimum. It is usually easier, however, to compute the value of $f$ at every point at which the global maximum or minimum might occur; the largest of these is the global maximum, the smallest is the global minimum.
So we compute $f(-2)=4$, $f(0)=0$, $f(1)=1$. The global maximum is 4 at $x=-2$ and the global minimum is 0 at $x=0$. $\square$
It is possible that there is no global maximum or minimum. It is difficult, and not particularly useful, to express a complete procedure for determining whether this is the case. Generally, the best approach is to gain enough understanding of the shape of the graph to decide. Fortunately, only a rough idea of the shape is usually needed.
There are some particularly nice cases that are easy. A continuous function on a closed interval $[a,b]$ always has both a global maximum and a global minimum, so examining the critical values and the endpoints is enough:
Theorem 6.1.2 (Extreme value theorem) If $f$ is continuous on a closed interval $[a,b]$, then it has both a minimum and a maximum point. That is, there are real numbers $c$ and $d$ in $[a,b]$ so that for every $x$ in $[a,b]$, $f(x)\le f(c)$ and $f(x)\ge f(d)$. $\qed$
Another easy case: If a function is continuous and has a single critical value, then if there is a local maximum at the critical value it is a global maximum, and if it is a local minimum it is a global minimum. There may also be a global minimum in the first case, or a global maximum in the second case, but that will generally require more effort to determine.
Example 6.1.3 Let $\ds f(x)=-x^2+4x-3$. Find the maximum value of $f(x)$ on the interval $[0,4]$. First note that $f'(x)= -2 x +4=0$ when $x=2$, and $f(2)= 1$. Next observe that $f'(x)$ is defined for all $x$, so there are no other critical values. Finally, $f(0) = -3$ and $f(4)= -3$. The largest value of $f(x)$ on the interval $[0,4]$ is $f(2)=1$. $\square$
Example 6.1.4 Let $\ds f(x)=-x^2+4x-3$. Find the maximum value of $f(x)$ on the interval $[-1,1]$.
First note that $f'(x)= -2 x +4=0$ when $x=2$. But $x=2$ is not in the interval, so we don't use it. Thus the only two points to be checked are the endpoints; $f(-1) = -8$ and $f(1)= 0$. So the largest value of $f(x)$ on $[-1,1]$ is $f(1)=0$. $\square$
Example 6.1.5 Find the maximum and minimum values of the function $f(x)= 7+|x-2|$ for $x$ between $1$ and $4$ inclusive. The derivative $f'(x)$ is never zero, but $f'(x)$ is undefined at $x=2$, so we compute $f(2)= 7$. Checking the end points we get $f(1)=8$ and $f(4)=9$. The smallest of these numbers is $f(2)=7$, which is, therefore, the minimum value of $f(x)$ on the interval $1 \le x \le 4$, and the maximum is $f(4)=9$. $\square$
Example 6.1.6 Find all local maxima and minima for $\ds f(x)=x^3-x$, and determine whether there is a global maximum or minimum on the open interval $(-2,2)$. In example 5.1.2 we found a local maximum at $\ds (-\sqrt3/3,2\sqrt{3}/9)$ and a local minimum at $\ds (\sqrt3/3,-2\sqrt{3}/9)$. Since the endpoints are not in the interval $(-2,2)$ they cannot be considered. Is the lone local maximum a global maximum? Here we must look more closely at the graph. We know that on the closed interval $\ds [-\sqrt3/3,\sqrt3/3]$ there is a global maximum at $\ds x=-\sqrt3/3$ and a global minimum at $\ds x=\sqrt3/3$. So the question becomes: what happens between $-2$ and $\ds -\sqrt3/3$, and between $\ds \sqrt3/3$ and $2$? Since there is a local minimum at $\ds x=\sqrt3/3$, the graph must continue up to the right, since there are no more critical values. This means no value of $f$ will be less than $\ds -2\sqrt{3}/9$ between $\ds \sqrt3/3$ and $2$, but it says nothing about whether we might find a value larger than the local maximum $\ds 2\sqrt{3}/9$. How can we tell? Since the function increases to the right of $\ds \sqrt3/3$, we need to know what the function values do "close to'' $2$. Here the easiest test is to pick a number and do a computation to get some idea of what's going on. Since $\ds f(1.9)=4.959>2\sqrt{3}/9$, there is no global maximum at $\ds -\sqrt3/3$, and hence no global maximum at all. (How can we tell that $\ds 4.959>2\sqrt{3}/9$? We can use a calculator to approximate the right hand side; if it is not even close to $4.959$ we can take this as decisive. Since $\ds 2\sqrt{3}/9\approx 0.3849$, there's really no question. Funny things can happen in the rounding done by computers and calculators, however, so we might be a little more careful, especially if the values come out quite close. In this case we can convert the relation $\ds 4.959>2\sqrt{3}/9$ into $\ds (9/2) 4.959>\sqrt{3}$ and ask whether this is true. Since the left side is clearly larger than $4\cdot 4$ which is clearly larger than $\ds \sqrt3$, this settles the question.)
A similar analysis shows that there is also no global minimum. The graph of $f(x)$ on $(-2,2)$ is shown in figure 6.1.2 . $\square$
Example 6.1.7 Of all rectangles of area 100, which has the smallest perimeter?
First we must translate this into a purely mathematical problem in which we want to find the minimum value of a function. If $x$ denotes one of the sides of the rectangle, then the adjacent side must be $100/x$ (in order that the area be 100). So the function we want to minimize is $$ f(x)=2x+2{100\over x} $$ since the perimeter is twice the length plus twice the width of the rectangle. Not all values of $x$ make sense in this problem: lengths of sides of rectangles must be positive, so $x>0$. If $x>0$ then so is $100/x$, so we need no second condition on $x$.
We next find $f'(x)$ and set it equal to zero: $\ds 0=f'(x)=2-200/x^2$. Solving $f'(x)=0$ for $x$ gives us $x=\pm 10$. We are interested only in $x>0$, so only the value $x=10$ is of interest. Since $f'(x)$ is defined everywhere on the interval $(0,\infty)$, there are no more critical values, and there are no endpoints. Is there a local maximum, minimum, or neither at $x=10$? The second derivative is $\ds f''(x)=400/x^3$, and $f''(10)>0$, so there is a local minimum. Since there is only one critical value, this is also the global minimum, so the rectangle with smallest perimeter is the $10\times10$ square. $\square$
Example 6.1.8 You want to sell a certain number $n$ of items in order to maximize your profit. Market research tells you that if you set the price at \$1.50, you will be able to sell 5000 items, and for every 10 cents you lower the price below \$1.50 you will be able to sell another 1000 items. Suppose that your fixed costs ("start-up costs'') total \$2000, and the per item cost of production ("marginal cost'') is \$0.50. Find the price to set per item and the number of items sold in order to maximize profit, and also determine the maximum profit you can get.
The first step is to convert the problem into a function maximization problem. Since we want to maximize profit by setting the price per item, we should look for a function $P(x)$ representing the profit when the price per item is $x$. Profit is revenue minus costs, and revenue is number of items sold times the price per item, so we get $P=nx-2000-0.50n$. The number of items sold is itself a function of $x$, $n=5000+1000(1.5-x)/0.10$, because $ (1.5-x)/0.10$ is the number of multiples of 10 cents that the price is below \$1.50. Now we substitute for $n$ in the profit function: $$ \eqalign{ P(x)&=(5000+1000(1.5-x)/0.10)x-2000- 0.5(5000+1000(1.5-x)/0.10)\cr &=-10000x^2+25000x-12000\cr} $$ We want to know the maximum value of this function when $x$ is between 0 and $1.5$. The derivative is $P'(x)=-20000x+25000$, which is zero when $x=1.25$. Since $P''(x)=-20000< 0$, there must be a local maximum at $x=1.25$, and since this is the only critical value it must be a global maximum as well. (Alternately, we could compute $P(0)=-12000$, $P(1.25)=3625$, and $P(1.5)=3000$ and note that $P(1.25)$ is the maximum of these.) Thus the maximum profit is \$3625, attained when we set the price at \$1.25 and sell 7500 items. $\square$
Example 6.1.9 Find the largest rectangle (that is, the rectangle with largest area) that fits inside the graph of the parabola $\ds y=x^2$ below the line $y=a$ ($a$ is an unspecified constant value), with the top side of the rectangle on the horizontal line $y=a$; see figure 6.1.3 .)
We want to find the maximum value of some function $A(x)$ representing area. Perhaps the hardest part of this problem is deciding what $x$ should represent. The lower right corner of the rectangle is at $\ds (x,x^2)$, and once this is chosen the rectangle is completely determined. So we can let the $x$ in $A(x)$ be the $x$ of the parabola $\ds f(x)=x^2$. Then the area is $\ds A(x)=(2x)(a-x^2)=-2x^3+2ax$. We want the maximum value of $A(x)$ when $x$ is in $\ds [0,\sqrt{a}]$. (You might object to allowing $x=0$ or $\ds x=\sqrt{a}$, since then the "rectangle'' has either no width or no height, so is not "really'' a rectangle. But the problem is somewhat easier if we simply allow such rectangles, which have zero area.)
Setting $\ds 0=A'(x)=-6x^2+2a$ we get $\ds x=\sqrt{a/3}$ as the only critical value. Testing this and the two endpoints, we have $\ds A(0)=A(\sqrt{a})=0$ and $\ds A(\sqrt{a/3})=(4/9)\sqrt{3}a^{3/2}$. The maximum area thus occurs when the rectangle has dimensions $\ds 2\sqrt{a/3}\times (2/3)a$. $\square$
Example 6.1.10 If you fit the largest possible cone inside a sphere, what fraction of the volume of the sphere is occupied by the cone? (Here by "cone'' we mean a right circular cone, i.e., a cone for which the base is perpendicular to the axis of symmetry, and for which the cross-section cut perpendicular to the axis of symmetry at any point is a circle.)
Let $R$ be the radius of the sphere, and let $r$ and $h$ be the base radius and height of the cone inside the sphere. What we want to maximize is the volume of the cone: $\ds \pi r^2h/3$. Here $R$ is a fixed value, but $r$ and $h$ can vary. Namely, we could choose $r$ to be as large as possible—equal to $R$—by taking the height equal to $R$; or we could make the cone's height $h$ larger at the expense of making $r$ a little less than $R$. See the cross-section depicted in figure 6.1.4 . We have situated the picture in a convenient way relative to the $x$ and $y$ axes, namely, with the center of the sphere at the origin and the vertex of the cone at the far left on the $x$-axis.
Notice that the function we want to maximize, $\ds \pi r^2h/3$, depends on two variables. This is frequently the case, but often the two variables are related in some way so that "really'' there is only one variable. So our next step is to find the relationship and use it to solve for one of the variables in terms of the other, so as to have a function of only one variable to maximize. In this problem, the condition is apparent in the figure: the upper corner of the triangle, whose coordinates are $(h-R,r)$, must be on the circle of radius $R$. That is, $$ (h-R)^2+r^2=R^2. $$ We can solve for $h$ in terms of $r$ or for $r$ in terms of $h$. Either involves taking a square root, but we notice that the volume function contains $\ds r^2$, not $r$ by itself, so it is easiest to solve for $\ds r^2$ directly: $\ds r^2=R^2-(h-R)^2$. Then we substitute the result into $\ds \pi r^2h/3$: $$ \eqalign{ V(h)&=\pi(R^2-(h-R)^2)h/3\cr &=-{\pi\over3}h^3+{2\over3}\pi h^2R\cr }$$ We want to maximize $V(h)$ when $h$ is between 0 and $2R$. Now we solve $\ds 0=f'(h)=-\pi h^2+(4/3)\pi h R$, getting $h=0$ or $h=4R/3$. We compute $V(0)=V(2R)=0$ and $\ds V(4R/3)=(32/81)\pi R^3$. The maximum is the latter; since the volume of the sphere is $\ds (4/3)\pi R^3$, the fraction of the sphere occupied by the cone is $${(32/81)\pi R^3\over (4/3)\pi R^3}={8\over 27}\approx 30\%.$$ $\square$
Example 6.1.11 You are making cylindrical containers to contain a given volume. Suppose that the top and bottom are made of a material that is $N$ times as expensive (cost per unit area) as the material used for the lateral side of the cylinder. Find (in terms of $N$) the ratio of height to base radius of the cylinder that minimizes the cost of making the containers.
Let us first choose letters to represent various things: $h$ for the height, $r$ for the base radius, $V$ for the volume of the cylinder, and $c$ for the cost per unit area of the lateral side of the cylinder; $V$ and $c$ are constants, $h$ and $r$ are variables. Now we can write the cost of materials: $$ c(2\pi rh)+Nc(2\pi r^2). $$ Again we have two variables; the relationship is provided by the fixed volume of the cylinder: $\ds V=\pi r^2h$. We use this relationship to eliminate $h$ (we could eliminate $r$, but it's a little easier if we eliminate $h$, which appears in only one place in the above formula for cost). The result is $$ f(r)=2c\pi r{V\over\pi r^2}+2Nc\pi r^2={2cV\over r}+2Nc\pi r^2. $$ We want to know the minimum value of this function when $r$ is in $(0,\infty)$. We now set $\ds 0=f'(r)=-2cV/r^2+4Nc\pi r$, giving $\ds r={\root 3 \of {V/(2N\pi)}}$. Since $\ds f''(r)=4cV/r^3+4Nc\pi$ is positive when $r$ is positive, there is a local minimum at the critical value, and hence a global minimum since there is only one critical value.
Finally, since $\ds h=V/(\pi r^2)$, $$ {h\over r}={V\over\pi r^3}={V\over \pi(V/(2N\pi))}=2N, $$ so the minimum cost occurs when the height $h$ is $2N$ times the radius. If, for example, there is no difference in the cost of materials, the height is twice the radius (or the height is equal to the diameter). $\square$
Example 6.1.12 Suppose you want to reach a point $A$ that is located across the sand from a nearby road (see figure 6.1.5 ). Suppose that the road is straight, and $b$ is the distance from $A$ to the closest point $C$ on the road. Let $v$ be your speed on the road, and let $w$, which is less than $v$, be your speed on the sand. Right now you are at the point $D$, which is a distance $a$ from $C$. At what point $B$ should you turn off the road and head across the sand in order to minimize your travel time to $A$?
Let $x$ be the distance short of $C$ where you turn off, i.e., the distance from $B$ to $C$. We want to minimize the total travel time. Recall that when traveling at constant velocity, time is distance divided by velocity.
You travel the distance $\ds \overline{DB}$ at speed $v$, and then the distance $\ds \overline{BA}$ at speed $w$. Since $\ds \overline{DB}=a-x$ and, by the Pythagorean theorem, $\ds \overline{BA}=\sqrt{x^2+b^2}$, the total time for the trip is $$ f(x)={a-x\over v}+{\sqrt{x^2+b^2}\over w}. $$ We want to find the minimum value of $f$ when $x$ is between 0 and $a$. As usual we set $f'(x)=0$ and solve for $x$: $$ \displaylines{ 0=f'(x)=-{1\over v}+{x\over w\sqrt{x^2+b^2}}\cr w\sqrt{x^2+b^2}=vx\cr w^2(x^2+b^2) = v^2x^2\cr w^2b^2=(v^2-w^2)x^2\cr x={wb\over\sqrt{v^2-w^2}} }$$ Notice that $a$ does not appear in the last expression, but $a$ is not irrelevant, since we are interested only in critical values that are in $[0,a]$, and $\ds wb/\sqrt{v^2-w^2}$ is either in this interval or not. If it is, we can use the second derivative to test it: $$ f''(x) = {b^2\over (x^2+b^2)^{3/2}w}. $$ Since this is always positive there is a local minimum at the critical point, and so it is a global minimum as well.
If the critical value is not in $[0,a]$ it is larger than $a$. In this case the minimum must occur at one of the endpoints. We can compute $$ \eqalign{ f(0)&={a\over v}+{b\over w}\cr f(a)&={\sqrt{a^2+b^2}\over w}\cr }$$ but it is difficult to determine which of these is smaller by direct comparison. If, as is likely in practice, we know the values of $v$, $w$, $a$, and $b$, then it is easy to determine this. With a little cleverness, however, we can determine the minimum in general. We have seen that $f''(x)$ is always positive, so the derivative $f'(x)$ is always increasing. We know that at $\ds wb/\sqrt{v^2-w^2}$ the derivative is zero, so for values of $x$ less than that critical value, the derivative is negative. This means that $f(0)>f(a)$, so the minimum occurs when $x=a$.
So the upshot is this: If you start farther away from $C$ than $\ds wb/\sqrt{v^2-w^2}$ then you always want to cut across the sand when you are a distance $\ds wb/\sqrt{v^2-w^2}$ from point $C$. If you start closer than this to $C$, you should cut directly across the sand. $\square$
Summary—Steps to solve an optimization problem.
1. Decide what the variables are and what the constants are, draw a diagram if appropriate, understand clearly what it is that is to be maximized or minimized.
2. Write a formula for the function for which you wish to find the maximum or minimum.
3. Express that formula in terms of only one variable, that is, in the form $f(x)$.
4. Set $f'(x)=0$ and solve. Check all critical values and endpoints to determine the extreme value.
Exercises 6.1
Ex 6.1.1 Let $\ds f(x) = \cases{1 + 4 x -x^2 & for $x\leq3$\cr (x+5)/2 &for $x>3$\cr}$
Find the maximum value and minimum values of $f(x)$ for $x$ in $[0,4]$. Graph $f(x)$ to check your answers. ( answer )
Ex 6.1.2 Find the dimensions of the rectangle of largest area having fixed perimeter $100$. ( answer )
Ex 6.1.3 Find the dimensions of the rectangle of largest area having fixed perimeter $P$. ( answer )
Ex 6.1.4 A box with square base and no top is to hold a volume $100$. Find the dimensions of the box that requires the least material for the five sides. Also find the ratio of height to side of the base. ( answer )
Ex 6.1.5 A box with square base is to hold a volume $200$. The bottom and top are formed by folding in flaps from all four sides, so that the bottom and top consist of two layers of cardboard. Find the dimensions of the box that requires the least material. Also find the ratio of height to side of the base. ( answer )
Ex 6.1.6 A box with square base and no top is to hold a volume $V$. Find (in terms of $V$) the dimensions of the box that requires the least material for the five sides. Also find the ratio of height to side of the base. (This ratio will not involve $V$.) ( answer )
Ex 6.1.7 You have $100$ feet of fence to make a rectangular play area alongside the wall of your house. The wall of the house bounds one side. What is the largest size possible (in square feet) for the play area? ( answer )
Ex 6.1.8 You have $l$ feet of fence to make a rectangular play area alongside the wall of your house. The wall of the house bounds one side. What is the largest size possible (in square feet) for the play area? ( answer )
Ex 6.1.9 Marketing tells you that if you set the price of an item at \$10 then you will be unable to sell it, but that you can sell 500 items for each dollar below \$10 that you set the price. Suppose your fixed costs total \$3000, and your marginal cost is \$2 per item. What is the most profit you can make? ( answer )
Ex 6.1.10 Find the area of the largest rectangle that fits inside a semicircle of radius $10$ (one side of the rectangle is along the diameter of the semicircle). ( answer )
Ex 6.1.11 Find the area of the largest rectangle that fits inside a semicircle of radius $r$ (one side of the rectangle is along the diameter of the semicircle). ( answer )
Ex 6.1.12 For a cylinder with surface area $50$, including the top and the bottom, find the ratio of height to base radius that maximizes the volume. ( answer )
Ex 6.1.13 For a cylinder with given surface area $S$, including the top and the bottom, find the ratio of height to base radius that maximizes the volume. ( answer )
Ex 6.1.14 You want to make cylindrical containers to hold 1 liter (1000 cubic centimeters) using the least amount of construction material. The side is made from a rectangular piece of material, and this can be done with no material wasted. However, the top and bottom are cut from squares of side $2r$, so that $\ds 2(2r)^2=8r^2$ of material is needed (rather than $\ds 2\pi r^2$, which is the total area of the top and bottom). Find the dimensions of the container using the least amount of material, and also find the ratio of height to radius for this container. ( answer )
Ex 6.1.15 You want to make cylindrical containers of a given volume $V$ using the least amount of construction material. The side is made from a rectangular piece of material, and this can be done with no material wasted. However, the top and bottom are cut from squares of side $2r$, so that $\ds 2(2r)^2=8r^2$ of material is needed (rather than $\ds 2\pi r^2$, which is the total area of the top and bottom). Find the optimal ratio of height to radius. ( answer )
Ex 6.1.16 Given a right circular cone, you put an upside-down cone inside it so that its vertex is at the center of the base of the larger cone and its base is parallel to the base of the larger cone. If you choose the upside-down cone to have the largest possible volume, what fraction of the volume of the larger cone does it occupy? (Let $H$ and $R$ be the height and base radius of the larger cone, and let $h$ and $r$ be the height and base radius of the smaller cone. Hint: Use similar triangles to get an equation relating $h$ and $r$.) ( answer )
Ex 6.1.17 In example 6.1.12 , what happens if $w\ge v$ (i.e., your speed on sand is at least your speed on the road)? ( answer )
Ex 6.1.18 A container holding a fixed volume is being made in the shape of a cylinder with a hemispherical top. (The hemispherical top has the same radius as the cylinder.) Find the ratio of height to radius of the cylinder which minimizes the cost of the container if (a) the cost per unit area of the top is twice as great as the cost per unit area of the side, and the container is made with no bottom; (b) the same as in (a), except that the container is made with a circular bottom, for which the cost per unit area is 1.5 times the cost per unit area of the side. ( answer )
Ex 6.1.19 A piece of cardboard is 1 meter by $1/2$ meter. A square is to be cut from each corner and the sides folded up to make an open-top box. What are the dimensions of the box with maximum possible volume? ( answer )
Ex 6.1.20 (a) A square piece of cardboard of side $a$ is used to make an open-top box by cutting out a small square from each corner and bending up the sides. How large a square should be cut from each corner in order that the box have maximum volume? (b) What if the piece of cardboard used to make the box is a rectangle of sides $a$ and $b$? ( answer )
Ex 6.1.21 A window consists of a rectangular piece of clear glass with a semicircular piece of colored glass on top; the colored glass transmits only $1/2$ as much light per unit area as the the clear glass. If the distance from top to bottom (across both the rectangle and the semicircle) is 2 meters and the window may be no more than 1.5 meters wide, find the dimensions of the rectangular portion of the window that lets through the most light. ( answer )
Ex 6.1.22 A window consists of a rectangular piece of clear glass with a semicircular piece of colored glass on top. Suppose that the colored glass transmits only $k$ times as much light per unit area as the clear glass ($k$ is between $0$ and $1$). If the distance from top to bottom (across both the rectangle and the semicircle) is a fixed distance $H$, find (in terms of $k$) the ratio of vertical side to horizontal side of the rectangle for which the window lets through the most light. ( answer )
Ex 6.1.23 You are designing a poster to contain a fixed amount $A$ of printing (measured in square centimeters) and have margins of $a$ centimeters at the top and bottom and $b$ centimeters at the sides. Find the ratio of vertical dimension to horizontal dimension of the printed area on the poster if you want to minimize the amount of posterboard needed. ( answer )
Ex 6.1.24 The strength of a rectangular beam is proportional to the product of its width $w$ times the square of its depth $d$. Find the dimensions of the strongest beam that can be cut from a cylindrical log of radius $r$. ( answer )
Ex 6.1.25 What fraction of the volume of a sphere is taken up by the largest cylinder that can be fit inside the sphere? ( answer )
Ex 6.1.26 The U.S. post office will accept a box for shipment only if the sum of the length and girth (distance around) is at most 108 in. Find the dimensions of the largest acceptable box with square front and back. ( answer )
Ex 6.1.27 Find the dimensions of the lightest cylindrical can containing 0.25 liter (=250 cm${}^3$) if the top and bottom are made of a material that is twice as heavy (per unit area) as the material used for the side. ( answer )
Ex 6.1.28 A conical paper cup is to hold $1/4$ of a liter. Find the height and radius of the cone which minimizes the amount of paper needed to make the cup. Use the formula $\ds \pi r\sqrt{r^2+h^2}$ for the area of the side of a cone. ( answer )
Ex 6.1.29 A conical paper cup is to hold a fixed volume of water. Find the ratio of height to base radius of the cone which minimizes the amount of paper needed to make the cup. Use the formula $\ds \pi r\sqrt{r^2+h^2}$ for the area of the side of a cone, called the lateral area of the cone. ( answer )
Ex 6.1.30 If you fit the cone with the largest possible surface area (lateral area plus area of base) into a sphere, what percent of the volume of the sphere is occupied by the cone? ( answer )
Ex 6.1.31 Two electrical charges, one a positive charge A of magnitude $a$ and the other a negative charge B of magnitude $b$, are located a distance $c$ apart. A positively charged particle $P$ is situated on the line between A and B. Find where $P$ should be put so that the pull away from $A$ towards $B$ is minimal. Here assume that the force from each charge is proportional to the strength of the source and inversely proportional to the square of the distance from the source. ( answer )
Ex 6.1.32 Find the fraction of the area of a triangle that is occupied by the largest rectangle that can be drawn in the triangle (with one of its sides along a side of the triangle). Show that this fraction does not depend on the dimensions of the given triangle. ( answer )
Ex 6.1.33 How are your answers to Problem 9 affected if the cost per item for the $x$ items, instead of being simply \$2, decreases below \$2 in proportion to $x$ (because of economy of scale and volume discounts) by 1 cent for each 25 items produced? ( answer )
Ex 6.1.34 You are standing near the side of a large wading pool of uniform depth when you see a child in trouble. You can run at a speed $\ds v_1$ on land and at a slower speed $\ds v_2$ in the water. Your perpendicular distance from the side of the pool is $a$, the child's perpendicular distance is $b$, and the distance along the side of the pool between the closest point to you and the closest point to the child is $c$ (see the figure below). Without stopping to do any calculus, you instinctively choose the quickest route (shown in the figure) and save the child. Our purpose is to derive a relation between the angle $\ds \theta_1$ your path makes with the perpendicular to the side of the pool when you're on land, and the angle $\ds \theta_2$ your path makes with the perpendicular when you're in the water. To do this, let $x$ be the distance between the closest point to you at the side of the pool and the point where you enter the water. Write the total time you run (on land and in the water) in terms of $x$ (and also the constants $\ds a,b,c,v_1,v_2$). Then set the derivative equal to zero. The result, called "Snell's law'' or the "law of refraction,'' also governs the bending of light when it goes into water. ( answer )
Help Center Help Center
- Help Center
- Trial Software
- Product Updates
- Documentation
Solve optimization problem or equation problem
Description
Use solve to find the solution of an optimization problem or equation problem.
For the full workflow, see Problem-Based Optimization Workflow or Problem-Based Workflow for Solving Equations .
sol = solve( prob ) solves the optimization problem or equation problem prob .
sol = solve( prob , x0 ) solves prob starting from the point or set of values x0 .
sol = solve( prob , x0 , ms ) solves prob using the ms multiple-start solver. Use this syntax to search for a better solution than you obtain when not using the ms argument.
sol = solve( ___ , Name,Value ) modifies the solution process using one or more name-value pair arguments in addition to the input arguments in previous syntaxes.
[ sol , fval ] = solve( ___ ) also returns the objective function value at the solution using any of the input arguments in previous syntaxes.
[ sol , fval , exitflag , output , lambda ] = solve( ___ ) also returns an exit flag describing the exit condition, an output structure containing additional information about the solution process, and, for non-integer optimization problems, a Lagrange multiplier structure.
collapse all
Solve Linear Programming Problem
Solve a linear programming problem defined by an optimization problem.
Solve Nonlinear Programming Problem Using Problem-Based Approach
Find a minimum of the peaks function, which is included in MATLAB®, in the region x 2 + y 2 ≤ 4 . To do so, create optimization variables x and y .
Create an optimization problem having peaks as the objective function.
Include the constraint as an inequality in the optimization variables.
Set the initial point for x to 1 and y to –1, and solve the problem.
Unsupported Functions Require fcn2optimexpr
If your objective or nonlinear constraint functions are not entirely composed of elementary functions, you must convert the functions to optimization expressions using fcn2optimexpr . See Convert Nonlinear Function to Optimization Expression and Supported Operations for Optimization Variables and Expressions .
To convert the present example:
Copyright 2018–2020 The MathWorks, Inc.
Solve Mixed-Integer Linear Program Starting from Initial Point
Compare the number of steps to solve an integer programming problem both with and without an initial feasible point. The problem has eight integer variables and four linear equality constraints, and all variables are restricted to be positive.
Create four linear equality constraints and include them in the problem.
Create an objective function and include it in the problem.
Solve the problem without using an initial point, and examine the display to see the number of branch-and-bound nodes.
For comparison, find the solution using an initial feasible point.
Giving an initial point does not always improve the problem. For this problem, using an initial point saves time and computational steps. However, for some problems, an initial point can cause solve to take more steps.
Specify Starting Points and Values for surrogateopt , Problem-Based
This example uses:
- Global Optimization Toolbox Global Optimization Toolbox
For some solvers, you can pass the objective and constraint function values, if any, to solve in the x0 argument. This can save time in the solver. Pass a vector of OptimizationValues objects. Create this vector using the optimvalues function.
The solvers that can use the objective function values are:
paretosearch
surrogateopt
The solvers that can use nonlinear constraint function values are:
For example, minimize the peaks function using surrogateopt , starting with values from a grid of initial points. Create a grid from -10 to 10 in the x variable, and –5/2 to 5/2 in the y variable with spacing 1/2. Compute the objective function values at the initial points.
Pass the values in the x0 argument by using optimvalues . This saves time for solve , as solve does not need to compute the values. Pass the values as row vectors.
Solve the problem using surrogateopt with the initial values.

Minimize Nonlinear Function Using Multiple-Start Solver, Problem-Based
Find a local minimum of the peaks function on the range - 5 ≤ x , y ≤ 5 starting from the point [–1,2] .
Try to find a better solution by using the GlobalSearch solver. This solver runs fmincon multiple times, which potentially yields a better solution.
GlobalSearch finds a solution with a better (lower) objective function value. The exit message shows that fmincon , the local solver, runs 15 times. The returned solution has an objective function value of about –6.5511, which is lower than the value at the first solution, 1.1224e–07.
Solve Integer Programming Problem with Nondefault Options
Solve the problem
min x ( - 3 x 1 - 2 x 2 - x 3 ) s u b j e c t t o { x 3 b i n a r y x 1 , x 2 ≥ 0 x 1 + x 2 + x 3 ≤ 7 4 x 1 + 2 x 2 + x 3 = 1 2
without showing iterative display.
Examine the solution.
Use intlinprog to Solve a Linear Program
Force solve to use intlinprog as the solver for a linear programming problem.
Return All Outputs
Solve the mixed-integer linear programming problem described in Solve Integer Programming Problem with Nondefault Options and examine all of the output data.
For a problem without any integer constraints, you can also obtain a nonempty Lagrange multiplier structure as the fifth output.
View Solution with Index Variables
Create and solve an optimization problem using named index variables. The problem is to maximize the profit-weighted flow of fruit to various airports, subject to constraints on the weighted flows.
Find the optimal flow of oranges and berries to New York and Los Angeles.
This display means that no oranges are going to NYC , 70 berries are going to NYC , 980 oranges are going to LAX , and no berries are going to LAX .
List the optimal flow of the following:
Fruit Airports
----- --------
Berries NYC
Oranges LAX
This display means that 70 berries are going to NYC , 28 apples are going to BOS , and 980 oranges are going to LAX .
Solve Nonlinear System of Equations, Problem-Based
To solve the nonlinear system of equations
exp ( - exp ( - ( x 1 + x 2 ) ) ) = x 2 ( 1 + x 1 2 ) x 1 cos ( x 2 ) + x 2 sin ( x 1 ) = 1 2
using the problem-based approach, first define x as a two-element optimization variable.
Create the first equation as an optimization equality expression.
Similarly, create the second equation as an optimization equality expression.
Create an equation problem, and place the equations in the problem.
Review the problem.
Solve the problem starting from the point [0,0] . For the problem-based approach, specify the initial point as a structure, with the variable names as the fields of the structure. For this problem, there is only one variable, x .
View the solution point.
If your equation functions are not composed of elementary functions, you must convert the functions to optimization expressions using fcn2optimexpr . For the present example:
See Supported Operations for Optimization Variables and Expressions and Convert Nonlinear Function to Optimization Expression .
Input Arguments
Prob — optimization problem or equation problem optimizationproblem object | equationproblem object.
Optimization problem or equation problem, specified as an OptimizationProblem object or an EquationProblem object. Create an optimization problem by using optimproblem ; create an equation problem by using eqnproblem .
The problem-based approach does not support complex values in an objective function, nonlinear equalities, or nonlinear inequalities. If a function calculation has a complex value, even as an intermediate value, the final result might be incorrect.
Example: prob = optimproblem; prob.Objective = obj; prob.Constraints.cons1 = cons1;
Example: prob = eqnproblem; prob.Equations = eqs;
x0 — Initial point structure | vector of OptimizationValues objects
Initial point, specified as a structure with field names equal to the variable names in prob .
For some Global Optimization Toolbox solvers, x0 can be a vector of OptimizationValues objects representing multiple initial points. Create the points using the optimvalues function. These solvers are:
ga (Global Optimization Toolbox) , gamultiobj (Global Optimization Toolbox) , paretosearch (Global Optimization Toolbox) and particleswarm (Global Optimization Toolbox) . These solvers accept multiple starting points as members of the initial population.
MultiStart (Global Optimization Toolbox) . This solver accepts multiple initial points for a local solver such as fmincon .
surrogateopt (Global Optimization Toolbox) . This solver accepts multiple initial points to help create an initial surrogate.
For an example using x0 with named index variables, see Create Initial Point for Optimization with Named Index Variables .
Example: If prob has variables named x and y : x0.x = [3,2,17]; x0.y = [pi/3,2*pi/3] .
Data Types: struct
ms — Multiple start solver MultiStart object | GlobalSearch object
Multiple start solver, specified as a MultiStart (Global Optimization Toolbox) object or a GlobalSearch (Global Optimization Toolbox) object. Create ms using the MultiStart or GlobalSearch commands.
Currently, GlobalSearch supports only the fmincon local solver, and MultiStart supports only the fmincon , fminunc , and lsqnonlin local solvers.
Example: ms = MultiStart;
Example: ms = GlobalSearch(FunctionTolerance=1e-4);
Name-Value Arguments
Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN , where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose Name in quotes.
Example: solve(prob,'Options',opts)
MinNumStartPoints — Minimum number of start points for MultiStart 20 (default) | positive integer
Minimum number of start points for MultiStart (Global Optimization Toolbox) , specified as a positive integer. This argument applies only when you call solve using the ms argument. solve uses all of the values in x0 as start points. If MinNumStartPoints is greater than the number of values in x0 , then solve generates more start points uniformly at random within the problem bounds. If a component is unbounded, solve generates points using the default artificial bounds for MultiStart .
Example: solve(prob,x0,ms,MinNumStartPoints=50)
Data Types: double
Options — Optimization options object created by optimoptions | options structure
Optimization options, specified as an object created by optimoptions or an options structure such as created by optimset .
Internally, the solve function calls a relevant solver as detailed in the 'solver' argument reference. Ensure that options is compatible with the solver. For example, intlinprog does not allow options to be a structure, and lsqnonneg does not allow options to be an object.
For suggestions on options settings to improve an intlinprog solution or the speed of a solution, see Tuning Integer Linear Programming . For linprog , the default 'dual-simplex' algorithm is generally memory-efficient and speedy. Occasionally, linprog solves a large problem faster when the Algorithm option is 'interior-point' . For suggestions on options settings to improve a nonlinear problem's solution, see Optimization Options in Common Use: Tuning and Troubleshooting and Improve Results .
Example: options = optimoptions('intlinprog','Display','none')
Solver — Optimization solver 'intlinprog' | 'linprog' | 'lsqlin' | 'lsqcurvefit' | 'lsqnonlin' | 'lsqnonneg' | 'quadprog' | 'fminbnd' | 'fminunc' | 'fmincon' | 'fminsearch' | 'fzero' | 'fsolve' | 'coneprog' | 'ga' | 'gamultiobj' | 'paretosearch' | 'patternsearch' | 'particleswarm' | 'surrogateopt' | 'simulannealbnd'
Optimization solver, specified as the name of a listed solver. For optimization problems, this table contains the available solvers for each problem type, including solvers from Global Optimization Toolbox . Details for equation problems appear below the optimization solver details.
For converting nonlinear problems with integer constraints using prob2struct , the resulting problem structure can depend on the chosen solver. If you do not have a Global Optimization Toolbox license, you must specify the solver. See Integer Constraints in Nonlinear Problem-Based Optimization .
The default solver for each optimization problem type is listed here.

If you choose lsqcurvefit as the solver for a least-squares problem, solve uses lsqnonlin . The lsqcurvefit and lsqnonlin solvers are identical for solve .
For maximization problems ( prob.ObjectiveSense is "max" or "maximize" ), do not specify a least-squares solver (one with a name beginning lsq ). If you do, solve throws an error, because these solvers cannot maximize.
For equation solving, this table contains the available solvers for each problem type. In the table,
* indicates the default solver for the problem type.
Y indicates an available solver.
N indicates an unavailable solver.
Supported Solvers for Equations
Example: 'intlinprog'
Data Types: char | string
ObjectiveDerivative — Indication to use automatic differentiation for objective function 'auto' (default) | 'auto-forward' | 'auto-reverse' | 'finite-differences'
Indication to use automatic differentiation (AD) for nonlinear objective function, specified as 'auto' (use AD if possible), 'auto-forward' (use forward AD if possible), 'auto-reverse' (use reverse AD if possible), or 'finite-differences' (do not use AD). Choices including auto cause the underlying solver to use gradient information when solving the problem provided that the objective function is supported, as described in Supported Operations for Optimization Variables and Expressions . For an example, see Effect of Automatic Differentiation in Problem-Based Optimization .
Solvers choose the following type of AD by default:
For a general nonlinear objective function, fmincon defaults to reverse AD for the objective function. fmincon defaults to reverse AD for the nonlinear constraint function when the number of nonlinear constraints is less than the number of variables. Otherwise, fmincon defaults to forward AD for the nonlinear constraint function.
For a general nonlinear objective function, fminunc defaults to reverse AD.
For a least-squares objective function, fmincon and fminunc default to forward AD for the objective function. For the definition of a problem-based least-squares objective function, see Write Objective Function for Problem-Based Least Squares .
lsqnonlin defaults to forward AD when the number of elements in the objective vector is greater than or equal to the number of variables. Otherwise, lsqnonlin defaults to reverse AD.
fsolve defaults to forward AD when the number of equations is greater than or equal to the number of variables. Otherwise, fsolve defaults to reverse AD.
Example: 'finite-differences'
ConstraintDerivative — Indication to use automatic differentiation for constraint functions 'auto' (default) | 'auto-forward' | 'auto-reverse' | 'finite-differences'
Indication to use automatic differentiation (AD) for nonlinear constraint functions, specified as 'auto' (use AD if possible), 'auto-forward' (use forward AD if possible), 'auto-reverse' (use reverse AD if possible), or 'finite-differences' (do not use AD). Choices including auto cause the underlying solver to use gradient information when solving the problem provided that the constraint functions are supported, as described in Supported Operations for Optimization Variables and Expressions . For an example, see Effect of Automatic Differentiation in Problem-Based Optimization .
EquationDerivative — Indication to use automatic differentiation for equations 'auto' (default) | 'auto-forward' | 'auto-reverse' | 'finite-differences'
Indication to use automatic differentiation (AD) for nonlinear constraint functions, specified as 'auto' (use AD if possible), 'auto-forward' (use forward AD if possible), 'auto-reverse' (use reverse AD if possible), or 'finite-differences' (do not use AD). Choices including auto cause the underlying solver to use gradient information when solving the problem provided that the equation functions are supported, as described in Supported Operations for Optimization Variables and Expressions . For an example, see Effect of Automatic Differentiation in Problem-Based Optimization .
Output Arguments
Sol — solution structure | optimizationvalues vector.
Solution, returned as a structure or an OptimizationValues vector. sol is an OptimizationValues vector when the problem is multiobjective. For single-objective problems, the fields of the returned structure are the names of the optimization variables in the problem. See optimvar .
fval — Objective function value at the solution real number | real vector | real matrix | structure
Objective function value at the solution, returned as one of the following:
If you neglect to ask for fval for an objective defined as an optimization expression or equation expression, you can calculate it using
If the objective is defined as a structure with only one field,
If the objective is a structure with multiple fields, write a loop.
exitflag — Reason solver stopped enumeration variable
Reason the solver stopped, returned as an enumeration variable. You can convert exitflag to its numeric equivalent using double(exitflag) , and to its string equivalent using string(exitflag) .
This table describes the exit flags for the intlinprog solver.
Exitflags 3 and -9 relate to solutions that have large infeasibilities. These usually arise from linear constraint matrices that have large condition number, or problems that have large solution components. To correct these issues, try to scale the coefficient matrices, eliminate redundant linear constraints, or give tighter bounds on the variables.
This table describes the exit flags for the linprog solver.
This table describes the exit flags for the lsqlin solver.
This table describes the exit flags for the quadprog solver.
This table describes the exit flags for the coneprog solver.
This table describes the exit flags for the lsqcurvefit or lsqnonlin solver.
This table describes the exit flags for the fminunc solver.
This table describes the exit flags for the fmincon solver.
This table describes the exit flags for the fsolve solver.
This table describes the exit flags for the fzero solver.
This table describes the exit flags for the patternsearch solver.
In the nonlinear constraint solver, the complementarity measure is the norm of the vector whose elements are c i λ i , where c i is the nonlinear inequality constraint violation, and λ i is the corresponding Lagrange multiplier.
This table describes the exit flags for the ga solver.
This table describes the exit flags for the particleswarm solver.
This table describes the exit flags for the simulannealbnd solver.
This table describes the exit flags for the surrogateopt solver.
This table describes the exit flags for the MultiStart and GlobalSearch solvers.
This table describes the exit flags for the paretosearch solver.
This table describes the exit flags for the gamultiobj solver.
output — Information about optimization process structure
Information about the optimization process, returned as a structure. The output structure contains the fields in the relevant underlying solver output field, depending on which solver solve called:
'fmincon' output
'fminunc' output
'fsolve' output
'fzero' output
'intlinprog' output
'linprog' output
'lsqcurvefit' or 'lsqnonlin' output
'lsqlin' output
'lsqnonneg' output
'quadprog' output
'ga' output (Global Optimization Toolbox)
'gamultiobj' output (Global Optimization Toolbox)
'paretosearch' output (Global Optimization Toolbox)
'particleswarm' output (Global Optimization Toolbox)
'patternsearch' output (Global Optimization Toolbox)
'simulannealbnd' output (Global Optimization Toolbox)
'surrogateopt' output (Global Optimization Toolbox)
'MultiStart' and 'GlobalSearch' return the output structure from the local solver. In addition, the output structure contains the following fields:
globalSolver — Either 'MultiStart' or 'GlobalSearch' .
objectiveDerivative — Takes the values described at the end of this section.
constraintDerivative — Takes the values described at the end of this section, or "auto" when prob has no nonlinear constraint.
solver — The local solver, such as 'fmincon' .
local — Structure containing extra information about the optimization.
sol — Local solutions, returned as a vector of OptimizationValues objects.
x0 — Initial points for the local solver, returned as a cell array.
exitflag — Exit flags of local solutions, returned as an integer vector.
output — Structure array, with one row for each local solution. Each row is the local output structure corresponding to one local solution.
solve includes the additional field Solver in the output structure to identify the solver used, such as 'intlinprog' .
When Solver is a nonlinear Optimization Toolbox™ solver, solve includes one or two extra fields describing the derivative estimation type. The objectivederivative and, if appropriate, constraintderivative fields can take the following values:
"reverse-AD" for reverse automatic differentiation
"forward-AD" for forward automatic differentiation
"finite-differences" for finite difference estimation
"closed-form" for linear or quadratic functions
lambda — Lagrange multipliers at the solution structure
Lagrange multipliers at the solution, returned as a structure.
solve does not return lambda for equation-solving problems.
For the intlinprog and fminunc solvers, lambda is empty, [] . For the other solvers, lambda has these fields:
Variables – Contains fields for each problem variable. Each problem variable name is a structure with two fields:
Lower – Lagrange multipliers associated with the variable LowerBound property, returned as an array of the same size as the variable. Nonzero entries mean that the solution is at the lower bound. These multipliers are in the structure lambda.Variables. variablename .Lower .
Upper – Lagrange multipliers associated with the variable UpperBound property, returned as an array of the same size as the variable. Nonzero entries mean that the solution is at the upper bound. These multipliers are in the structure lambda.Variables. variablename .Upper .
Constraints – Contains a field for each problem constraint. Each problem constraint is in a structure whose name is the constraint name, and whose value is a numeric array of the same size as the constraint. Nonzero entries mean that the constraint is active at the solution. These multipliers are in the structure lambda.Constraints. constraintname .
Elements of a constraint array all have the same comparison ( <= , == , or >= ) and are all of the same type (linear, quadratic, or nonlinear).
Conversion to Solver Form
Internally, the solve function solves optimization problems by calling a solver. For the default solver for the problem and supported solvers for the problem, see the solvers function. You can override the default by using the 'solver' name-value pair argument when calling solve .
Before solve can call a solver, the problems must be converted to solver form, either by solve or some other associated functions or objects. This conversion entails, for example, linear constraints having a matrix representation rather than an optimization variable expression.
The first step in the algorithm occurs as you place optimization expressions into the problem. An OptimizationProblem object has an internal list of the variables used in its expressions. Each variable has a linear index in the expression, and a size. Therefore, the problem variables have an implied matrix form. The prob2struct function performs the conversion from problem form to solver form. For an example, see Convert Problem to Structure .
For nonlinear optimization problems, solve uses automatic differentiation to compute the gradients of the objective function and nonlinear constraint functions. These derivatives apply when the objective and constraint functions are composed of Supported Operations for Optimization Variables and Expressions . When automatic differentiation does not apply, solvers estimate derivatives using finite differences. For details of automatic differentiation, see Automatic Differentiation Background . You can control how solve uses automatic differentiation with the ObjectiveDerivative name-value argument.
For the algorithm that intlinprog uses to solve MILP problems, see intlinprog Algorithm . For the algorithms that linprog uses to solve linear programming problems, see Linear Programming Algorithms . For the algorithms that quadprog uses to solve quadratic programming problems, see Quadratic Programming Algorithms . For linear or nonlinear least-squares solver algorithms, see Least-Squares (Model Fitting) Algorithms . For nonlinear solver algorithms, see Unconstrained Nonlinear Optimization Algorithms and Constrained Nonlinear Optimization Algorithms . For Global Optimization Toolbox solver algorithms, see Global Optimization Toolbox documentation.
For nonlinear equation solving, solve internally represents each equation as the difference between the left and right sides. Then solve attempts to minimize the sum of squares of the equation components. For the algorithms for solving nonlinear systems of equations, see Equation Solving Algorithms . When the problem also has bounds, solve calls lsqnonlin to minimize the sum of squares of equation components. See Least-Squares (Model Fitting) Algorithms .
If your objective function is a sum of squares, and you want solve to recognize it as such, write it as either norm(expr)^2 or sum(expr.^2) , and not as expr'*expr or any other form. The internal parser recognizes a sum of squares only when represented as a square of a norm or an explicit sums of squares. For details, see Write Objective Function for Problem-Based Least Squares . For an example, see Nonnegative Linear Least Squares, Problem-Based .
Automatic Differentiation
Automatic differentiation (AD) applies to the solve and prob2struct functions under the following conditions:
The objective and constraint functions are supported, as described in Supported Operations for Optimization Variables and Expressions . They do not require use of the fcn2optimexpr function.
The solver called by solve is fmincon , fminunc , fsolve , or lsqnonlin .
For optimization problems, the 'ObjectiveDerivative' and 'ConstraintDerivative' name-value pair arguments for solve or prob2struct are set to 'auto' (default), 'auto-forward' , or 'auto-reverse' .
For equation problems, the 'EquationDerivative' option is set to 'auto' (default), 'auto-forward' , or 'auto-reverse' .
When these conditions are not satisfied, solve estimates gradients by finite differences, and prob2struct does not create gradients in its generated function files.
To use automatic derivatives in a problem converted by prob2struct , pass options specifying these derivatives.
Currently, AD works only for first derivatives; it does not apply to second or higher derivatives. So, for example, if you want to use an analytic Hessian to speed your optimization, you cannot use solve directly, and must instead use the approach described in Supply Derivatives in Problem-Based Workflow .
Extended Capabilities
Automatic parallel support accelerate code by automatically running computation in parallel using parallel computing toolbox™..
solve estimates derivatives in parallel for nonlinear solvers when the UseParallel option for the solver is true . For example,
solve does not use parallel derivative estimation when all objective and nonlinear constraint functions consist only of supported operations, as described in Supported Operations for Optimization Variables and Expressions . In this case, solve uses automatic differentiation for calculating derivatives. See Automatic Differentiation .
You can override automatic differentiation and use finite difference estimates in parallel by setting the 'ObjectiveDerivative' and 'ConstraintDerivative' arguments to 'finite-differences' .
When you specify a Global Optimization Toolbox solver that support parallel computation ( ga (Global Optimization Toolbox) , particleswarm (Global Optimization Toolbox) , patternsearch (Global Optimization Toolbox) , and surrogateopt (Global Optimization Toolbox) ), solve compute in parallel when the UseParallel option for the solver is true . For example,
Version History
R2018b: solve(prob,solver) , solve(prob,options) , and solve(prob,solver,options) syntaxes have been removed.
To choose options or the underlying solver for solve , use name-value pairs. For example,
The previous syntaxes were not as flexible, standard, or extensible as name-value pairs.
evaluate | OptimizationProblem | EquationProblem | optimoptions | prob2struct | fcn2optimexpr | optimvalues | solvers
- Problem-Based Optimization Workflow
- Problem-Based Workflow for Solving Equations
- Create Initial Point for Optimization with Named Index Variables
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
- Switzerland (English)
- Switzerland (Deutsch)
- Switzerland (Français)
- 中国 (English)
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
- América Latina (Español)
- Canada (English)
- United States (English)
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
Contact your local office
- Exponent Laws and Logarithm Laws
- Trig Formulas and Identities
- Differentiation Rules
- Trig Function Derivatives
- Table of Derivatives
- Table of Integrals
- Calculus Home
How to Solve Optimization Problems in Calculus
- July 7, 2016
- by Bruce Birkett
- Tags: Calculus , can , optimization , problem solving strategy
- 16 Comments
Need to solve Optimization problems in Calculus? Let’s break ’em down and develop a strategy that you can use to solve them routinely for yourself.
- Find the largest ….
- Find the minimum….
- What dimensions will give the greatest…?
The first stage doesn’t involve Calculus at all, while by contrast the second stage is just a max/min problem that you recently learned how to solve: Stage I. Develop the function. You must first convert the problem’s description of the situation into a function — crucially, a function that depends on only one single variable.
Stage II. Maximize or minimize that function. Now maximize or minimize the function you just developed. You’ll use your usual Calculus tools to find the critical points, determine whether each is a maximum or minimum, and so forth. We’ll break these two big Stages into smaller steps below. To illustrate those steps, let’s together solve this classic Optimization example problem:

Stage I. Develop the function

Step 2. Most frequently you’ll use your geometry knowledge. Having drawn the picture, the next step is to write an equation for the quantity we want to optimize . Most frequently you’ll use your everyday knowledge of geometry for this step. In this problem, for instance, we want to minimize the cost of constructing the can, which means we want to use as little metal as possible . Hence we want to minimize the can’s surface area . So let’s write an equation for that total surface area:
\begin{align*} A_\text{total} &= A_\text{top} + A_\text{cylinder} + A_\text{bottom} \\[8px] &= \pi r^2 + 2\pi r h + \pi r^2 \\[8px] &= 2\pi r^2 + 2 \pi r h \end{align*}
That’s it; you’re done with Step 2! You’ve written an equation for the quantity you want to minimize $(A_\text{total})$ in terms of the relevant quantities ( r and h ).
- Optimization Problems & Complete Solutions
Step 3. Here’s a key thing to know about how to solve Optimization problems: you’ll almost always have to use detailed information given in the problem to rewrite the equation you developed in Step 2 to be in terms of one single variable.
Above, for instance, our equation for $A_\text{total}$ has two variables, r and h . We must eliminate one of them in order to proceed. The choice of which to keep and which to eliminate is arbitrary; for our solution here, we choose to keep r . (We could just as easily choose h , and develop our solution along that path instead. We’d arrive at the same final result.) Since we’re choosing to work with r , we need to use other detailed information given in the problem to write h in terms of r so we can substitute for h as a variable.
Begin subproblem.
To accomplish this substitution, we look back to see what other constraints/information the problem gave us: recall that the can must hold an amount V of liquid, where V is some number. ( V might be 355 cm$^3$, for instance.) Now a cylinder of radius r and height h has a volume of $V = \pi r^2 h,$ and so we can solve for h in terms of V and constants: $$V = \pi r^2 h$$ thus $$h = \dfrac{V}{\pi r^2} $$ That’s our expression for h in terms of r (and the constants V and $\pi).$ End subproblem.
We’re done with Step 3: we now have the function in terms of a single variable, r : $$A(r) = 2\pi r^2 + \frac{2V}{r}$$ We’re now writing $A(r)$ to emphasize that A is a function of only the single variable r , and we’ve dropped the subscript “total” from $A_\text{total}$ since we no longer need it.
This also concludes Stage I of our work: in these threes steps, we’ve developed the function we’re now going to minimize!
Notice, by the way, that so far in our solution we haven’t used any Calculus at all. That will always be the case when you solve an Optimization problem: you don’t use Calculus until you come to Stage II.
☕ Buy us a coffee We're working to add more, and would appreciate your help to keep going! 😊
Stage II: Maximize or minimize your function
For instance, a few weeks ago you could have gotten this as a standard max/min homework problem:

You would probably automatically find the derivative $A'(r)$ (which you could equivalently write as $\dfrac{dA}{dr})$, then find the critical points, then determine whether each represents a maximum or a minimum for the function, and so forth. That’s exactly what we’re now going to do in Stage II. Hence, you already know how to do all of the following steps; the only new part to maximization problems is what we did in Stage I above.
Step 4. We want to minimize the function $$ A(r) = 2\pi r^2 + \frac{2V}{r}$$ and so of course we must take the derivative, and then find the critical points .
The critical points occur when $A'(r) = 0$: \[ \begin{align*} A'(r) = 0 &= 4 \pi r\, – \frac{2V}{r^2} \\[8px] \frac{2V}{r^2} &= 4 \pi r \\[8px] \frac{2V}{4 \pi} &= r^3 \\[8px] r^3 &= \frac{V}{2\pi} \\[8px] r &= \sqrt[3]{\frac{V}{2\pi}} \end{align*} \] We thus have only one critical point to examine, at $r = \sqrt[3]{\dfrac{V}{2\pi}}\,.$
Step 5. Next we must justify that the critical point we’ve found represents a minimum for the can’s surface area (as opposed to a maximum, or a saddle point). We could reason physically, or use the First Derivative Test, but we think it’s easiest in this case to use the Second Derivative Test. Let’s quickly compute the second derivative, starting with the first derivative that we found above:
Since $r > 0$, this second derivative $\left(A’^\prime(r) = 4\pi + \dfrac{4V}{r^3}\right)$ is always positive $\left(A’^\prime(r) > 0 \right)$. That is, the graph of A(r) versus r is always concave up. Hence this single critical point gives us a minimum (as opposed to a maximum or saddlepoint), which is what we’re after:

The minimum surface area occurs when $r = \sqrt[3]{\dfrac{V}{2\pi}}\,. \quad \triangleleft$
Step 6. Now that we’ve found the critical point that corresponds to the can’s minimum surface area (thereby minimizing the cost), let’s finish answering the question : The problem asked us to find the dimensions — the radius and height — of the least-expensive can. We’ve already found the relevant radius, $r = \sqrt[3]{\dfrac{V}{2\pi}}\,.$
To find the corresponding height, recall that in the Subproblem above we found that since the can must hold a volume V of liquid, its height is related to its radius according to $$h = \dfrac{V}{\pi r^2}\,. $$ Hence when $r = \sqrt[3]{\dfrac{V}{2\pi}}\,,$ \[ \begin{align*} h &= \frac{V}{\pi}\,\frac{1}{r^2} \\[8px] &= \frac{V}{\pi}\,\frac{1}{\left( \sqrt[3]{\frac{V}{2\pi}}\right)^2} \\[8px] &= \frac{V}{\pi}\,\frac{2^{2/3}\pi^{2/3}}{V^{2/3}} \\[8px] &= 2^{2/3}\frac{V^{1/3}}{\pi^{1/3}} \\[8px] h &= 2^{2/3}\sqrt[3]{\frac{V}{\pi}} \quad \triangleleft \end{align*} \] The preceding expression for h is correct, but we can gain a nice insight by noticing that $$2^{2/3} = 2 \cdot\frac{1}{2^{1/3}}$$ and so \[ \begin{align*} h &= 2^{2/3}\sqrt[3]{\frac{V}{\pi}} \\[8px] &= 2 \cdot\frac{1}{2^{1/3}}\,\sqrt[3]{\frac{V}{\pi}} \\[8px] &= 2 \sqrt[3]{\frac{V}{2\pi}} = 2r \end{align*} \] since recall that the ideal radius is $r = \sqrt[3]{\dfrac{V}{2\pi}}\,.$ Hence the ideal height h is exactly twice the ideal radius.
Step 7. One last check You’ll lose points if you don’t answer the question that was asked. Because Optimization solutions can be long, we recommend that before finishing you go back and check what quantity/quantities the problem requested, and make sure you’ve provided that — especially on an exam, where you’ll lose points if you don’t answer the exact question that was asked. For example, the problem could have asked to find the value of the smallest possible surface area A , or the minimum cost.
Instead, in this case, the problem stated, “What dimensions (height and radius) will minimize the cost of metal to construct the can?” We have provided those two dimensions, and so we are done. $\checkmark$
☕ Buy us a coffee If we've helped, please consider giving a little something back. Thank you! 😊
Summary: Problem Solving Strategy
We’ve now illustrated the steps we use to solve every single Optimization problem we encounter, and they always work. PROBLEM SOLVING STRATEGY: Optimization The strategy consists of two Big Stages. The first does not involve Calculus at all; the second is identical to what you did for max/min problems.
Stage I: Develop the function.
- Draw a picture of the physical situation. Also note any physical restrictions determined by the physical situation.
- Write an equation that relates the quantity you want to optimize in terms of the relevant variables.
- If necessary, use other given information to rewrite your equation in terms of a single variable.
Stage II: Maximize or minimize the function.
- Take the derivative of your equation with respect to your single variable. Then find the critical points.
- Determine the maxima and minima as necessary. Remember to check the endpoints if there are any.
- Justify your maxima or minima either by reasoning about the physical situation, or with the first derivative test, or with the second derivative test.
- Finally, check to make sure you have answered the question as asked : Re-read the problem and verify that you are providing the value(s) requested: an x or y value; or coordinates; or a maximum area; or a shortest time; whatever was asked.
For now, over to you:
- What tips do you have to share about how to solve Optimization problems?
- What questions do you have? Optimization problems can be tricky to start, and we’re happy to help !
- How can we make posts such as this one more useful to you?
Please head to our Forum and post!
[Thanks to S. Campbell for his specific research into students’ learning of Optimization:
“College Student Difficulties with Applied Optimization Problems in Introductory Calculus,” unpublished masters thesis, The University of Maine, 2013.]
Share a link to this screen:
- Share on Facebook
- Share on Pinterest
- Email this Page
- Share on Reddit
- Share on Telegram
- Share on WhatsApp
- Share on SMS
These days we use our Forum for comments and discussion of this topic, and for any math questions. We'd love to see you there and help! Please tap to visit our Forum: community.matheno.com
What are your thoughts or questions.
Man, if only everyone was a thorough in their explanations as this one is
Thank you for the compliment. We are very happy to have helped! : )
Nice explanation and methodical approach. Setting up the problem is 99% of the problem. I’m still trying to figure out on other optimization solutions what yo do if the 2nd derivative is simply a constant. If f ‘(x) has a desired min or max, and f ‘’(x) differentiates to a constant, what does this mean to the max or min in the first derivative test? Does the sign of the constant alone in f ‘’(x) then determine concavity since there’s no potential inflection point? If that constant’s sign is negative (concave down) and the solution requires an optimization max, does that satisfy a proof? And vice versa if concavity is positive (concave up) confirm a minimum in the first derivative test?
Thanks, Chris. We’re glad to know you liked our explanation and approach. And agreed about getting the problem set-up right as the vast majority of the work here.
The answer to all of your questions is: yes! If the second derivative is a negative constant, then the function is concave down everywhere, and so you’re guaranteed that the point x=c you found where f'(c) = 0 is a maximum. (See the figure below.) Similarly, if the second derivative is a positive constant, then the function is concave up everywhere, and so the point x=c where f'(c) = 0 is guaranteed to be a minimum. And the fact that there’s no point of inflection anywhere doesn’t affect those conclusions.
The only thing that you wrote that isn’t quite right are the very last words, “in the first derivative test”; instead, you’re using the Second Derivative Test . That test is just as conclusive as the First Derivative Test, and is often easier to use. The one exception is if the second derivative is zero at the point of interest (f”(c)=0), in which case the Second Derivative Test is inconclusive and you have to revert to the First Derivative Test. But otherwise, the conclusion you reach with the Second Derivative test is indeed conclusive.
Hope that helps, and thanks for asking!

what problems can help to solve optimization
Thanks for asking! We have more completely solved optimization problems on this page: Optimization: Problems and Solutions .
We hope that helps!
very nicely organized! however i think it would have been more effective with some numbers, instead of variables. it can get hard to follow, especially when there’s multiple(in this case). but it was still lovely and easy to follow
Thank you for your nice comment, and for your suggestion. We’ll keep it in mind for future posts. For now: thanks very much!
I am having a tough time differentiating what it means when they say minimize(or maximize) a situation, as in how do the answers vary one from the other? I understand all the steps. I just want to be sure I pick the right “direction” when presented with an optimization problem….
Thanks for asking, Jon!
We’re happy to try to answer your question. First, we’d like to ask for a bit of clarification so we can be sure we address the question you actually have. Can you say a bit more about “how do the answers vary one from the other” ? Even better, could you give us an example, or two, of a problem where you don’t know what direction to pick initially? Is it that you’re not sure whether you need to maximize or minimize a particular quantity, or that when you’re presented with a situation you don’t know where to begin at all, or ??
And we know it’s tough to ask a clear question when you’re learning a new topic, so please just add whatever you can.
Thanks very much, and thanks again for posting your question, which I’m sure other students have as well!
What if you want to know the optimal volume needed for one product to finish at the same time with the other
We’re sorry that we don’t quite understand the question you’re asking. If you would like to provide more detail, perhaps with the statement of a problem you’re working to solve, we’ll be very happy to try to assist.
For now, thank you for your initial query!
Jump to solved problems
- Evaluating Limits
- Limits at Infinity
- Limits at Infinity with Square Roots
- Calculating Derivatives
- Equation of a Tangent Line
- Mean Value Theorem & Rolle’s Theorem
- Garden fence
- Least expensive open-topped can
- Printed poster
- Snowball melts
- Snowball melts, area decreases at given rate
- How fast is the ladder’s top sliding
- Angle changes as a ladder slides
- Lamp post casts shadow of man walking
- Water drains from a cone
- Given an equation, find a rate
We have new material coming very soon. Please watch our new Forum for announcements:
Community.Matheno.com
You can ask any Calculus questions there, too! We'd like to help, so please visit.
This site is free?!?
We don't charge for anything on this site, we don't run ads, and we will never sell your personal information.
We're passionate educators with a goal:
Provide high-quality, interactive materials to dedicated learners everywhere in the world, regardless of ability to pay, so they (you!) can learn well and excel.

- Terms of Use
- Privacy Policy
Matheno ®
Berkeley, California

AP ® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this site.
© 2014–2023 Matheno, Inc.
- Your answers to multiple choice questions;
- Your self-chosen confidence rating for each problem, so you know which to return to before an exam (super useful!);
- Your progress, and specifically which topics you have marked as complete for yourself.
Your selections are for your use only, and we do not share your specific data with anyone else. We do use aggregated data to help us see, for instance, where many students are having difficulty, so we know where to focus our efforts.
You will also be able to post any Calculus questions that you have on our Forum , and we'll do our best to answer them!
We believe that free, high-quality educational materials should be available to everyone working to learn well. There is no cost to you for having an account, other than our gentle request that you contribute what you can, if possible, to help us maintain and grow this site.
Please join our community of learners. We'd love to help you learn as well as you can!

IMAGES
VIDEO
COMMENTS
The six steps of problem solving involve problem definition, problem analysis, developing possible solutions, selecting a solution, implementing the solution and evaluating the outcome. Problem solving models are used to address issues that...
Maytag washers are reliable and durable machines, but like any appliance, they can experience problems from time to time. Fortunately, many of the most common issues can be solved quickly and easily. Here’s a look at how to troubleshoot som...
Are you a beginner when it comes to solving Sudoku puzzles? Do you find yourself frustrated and unsure of where to start? Fear not, as we have compiled a comprehensive guide on how to improve your problem-solving skills through Sudoku.
Optimization problems are like men. They're all the same amirite?
Learn how to solve any optimization problem in Calculus 1! This video explains what optimization problems are and a straight forward 5 step
Problem-Solving Strategy: Solving Optimization Problems · Introduce all variables. · Determine which quantity is to be maximized or minimized, and
Guideline for Solving Optimization Problems. · Identify what is to be maximized or minimized and what the constraints are. · Draw a diagram (if appropriate) and
Method for Solving Optimization Problems in Calculus · Step 1: Fully understand the problem · Step 2: Draw a diagram · Step 3: Introduce necessary variables · Step
Many of these problems can be solved by finding the appropriate function and then using techniques of calculus to find the maximum or the minimum value
using the problem-based approach, first define x as a two-element optimization variable. x = optimvar('x',2);. Create the first equation as an optimization
4. Reduce the objective function to one variable. Solve each of the constraint equations for one of the variables and substitute this into the objective
In optimization problems we are looking for the largest value or the smallest value that a function can take. We saw how to solve one kind of
In mathematics, computer science and economics, an optimization problem is the problem of finding the best solution from all feasible solutions.
Optimization problems will always ask you to maximize or minimize some quantity, having described the situation using words (instead of