diff --git a/.devcontainer.json b/.devcontainer.json index ed2623030..ae8eddb74 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -27,7 +27,7 @@ }, // Respect the project's designated dependencies, and create codechat config file - "postCreateCommand": "pip install -r requirements.txt && git config core.hooksPath .githooks && touch codechat_config.yaml", + "postCreateCommand": "bash scripts/setup.sh", // Port forwarding // --------------- @@ -71,18 +71,18 @@ "other": "off" }, "editor.snippetSuggestions": "top", - "xml.validation.enabled": false, + "xml.validation.enabled": true, + "pretext-tools.schema.versionName": "Custom", + "pretext-tools.schema.customPath": "/workspaces/library/schema/tbil.rng", + "redhat.telemetry.enabled": false, "CodeChat.CodeChatServer.Command": "CodeChat_Server", - "files.eol": "\n", - "files.associations": { - "*.sage": "python" - } + "files.eol": "\n" }, "extensions": [ - "ms-vscode.live-server", "oscarlevin.pretext-tools", "CodeChat.codechat", - "streetsidesoftware.code-spell-checker" + "streetsidesoftware.code-spell-checker", + "lov3.sagemath-enhanced" ] } } diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index ff5fc3445..118591121 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -17,6 +17,7 @@ jobs: build: runs-on: ubuntu-latest container: oscarlevin/pretext:full + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) steps: - name: Checkout source @@ -25,23 +26,15 @@ jobs: - name: install deps run: pip install -r requirements.txt - - name: quick build instructor versions - id: quickbuild - if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) && github.event_name != 'workflow_dispatch' - run: | - pretext build precalculus-web-instructor -q - pretext build calculus-web-instructor -q - pretext build linear-algebra-web-instructor -q - - name: build all deploy targets - if: steps.quickbuild.outcome == 'skipped' + # if: steps.quickbuild.outcome == 'skipped' run: pretext build --deploys - name: stage deployment run: pretext deploy --stage-only - name: build and stage all banks - if: steps.quickbuild.outcome == 'skipped' + # if: steps.quickbuild.outcome == 'skipped' run: | python scripts/build_bank.py precalculus --full python scripts/build_bank.py calculus --full @@ -53,10 +46,76 @@ jobs: name: deploy path: output/stage - deploy-cloudflare: + deploy-ghpages: runs-on: ubuntu-latest needs: build - if: vars.CLOUDFLARE_PROJECT_NAME != '' && github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Download website artifact + uses: actions/download-artifact@v4 + with: + name: deploy + path: deploy + - name: Setup GitHub Pages + id: check + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: deploy + - name: Deploy to Github Pages + id: deployment + uses: actions/deploy-pages@v4 + + preview: + runs-on: ubuntu-latest + container: oscarlevin/pretext:full + if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + outputs: + markdown: ${{ steps.changes.outputs.markdown }} + + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: install deps + run: pip install -r requirements.txt + + - name: Set necessary Git permission + run: git config --global --add safe.directory $(pwd) + + - name: build previews of all changed files + id: changes + run: python -m scripts.quickbuild_changes + + - name: stage deployment + run: pretext deploy --stage-only + + # - name: build and stage all banks + # run: | + # python scripts/build_bank.py precalculus --full + # python scripts/build_bank.py calculus --full + # python scripts/build_bank.py linear-algebra --full + + - name: Bundle output/stage as artifact + uses: actions/upload-artifact@v4 + with: + name: deploy + path: output/stage + + deploy-cloudflare: + runs-on: ubuntu-latest + needs: preview + if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) permissions: contents: read deployments: write @@ -70,8 +129,8 @@ jobs: path: deploy - name: Create 404.html run: echo "404 page not found" >> deploy/404.html - - name: Delete CheckIt builds not supported by CloudFlare - run: find . -name "bank.json" -type f -delete + # - name: Delete CheckIt builds not supported by CloudFlare + # run: find . -name "bank.json" -type f -delete - name: Publish to Cloudflare id: cloudflare_publish uses: cloudflare/pages-action@v1 @@ -87,37 +146,11 @@ jobs: if: github.event_name == 'pull_request' with: script: | + cf_url = "${{ steps.cloudflare_publish.outputs.url }}" github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '## 🚀 Preview available 🚀\n\n${{ steps.cloudflare_publish.outputs.url }}\n\n- [Precalculus](${{ steps.cloudflare_publish.outputs.url }}/preview/precalculus/instructor/frontmatter)\n\n- [Calculus](${{ steps.cloudflare_publish.outputs.url }}/preview/calculus/instructor/frontmatter)\n\n- [Linear Algebra](${{ steps.cloudflare_publish.outputs.url }}/preview/linear-algebra/instructor/frontmatter)' + body: `${{ needs.preview.outputs.markdown }}` }) - deploy-ghpages: - runs-on: ubuntu-latest - needs: build - if: vars.PTX_ENABLE_DEPLOY_GHPAGES == 'yes' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) - permissions: - contents: read - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Download website artifact - uses: actions/download-artifact@v4 - with: - name: deploy - path: deploy - - name: Setup GitHub Pages - id: check - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: deploy - - name: Deploy to Github Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/requirements.txt b/requirements.txt index 0a31b9dcb..4093cd034 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pretext == 2.6.2 +pretext == 2.10.1 pelican == 4.9.1 checkit-dashboard == 0.2.6 diff --git a/schema/tbil.rng b/schema/tbil.rng new file mode 100644 index 000000000..67fd96836 --- /dev/null +++ b/schema/tbil.rng @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/preview_outcome.py b/scripts/preview_outcome.py index 72c64a994..4a764f467 100644 --- a/scripts/preview_outcome.py +++ b/scripts/preview_outcome.py @@ -8,7 +8,7 @@ from checkit.bank import Bank from checkit import static -def main(book:str, outcome:str, amount:int = 20): +def build_preview(book:str, outcome:str, amount:int = 20): # check that this outcome exists exercise_path = Path("source", book, "exercises") sage_library_path = Path("source", book, "sage") @@ -89,9 +89,15 @@ def main(book:str, outcome:str, amount:int = 20): # copy assets shutil.copytree(b.build_path(), os.path.join(docs_path, "assets"), dirs_exist_ok=True) + return sandbox_bank_path + + +def main(book:str, outcome:str, amount:int = 20): + sandbox_bank_path = build_preview(book, outcome, amount) subprocess.run(['python', '-m', 'http.server', '-d', str(sandbox_bank_path/'docs')]) + if __name__ == "__main__": parser = argparse.ArgumentParser(description='Preview a CheckIt outcome.') parser.add_argument('book', choices=['precalculus', 'calculus', 'linear-algebra']) diff --git a/scripts/quickbuild_changes.py b/scripts/quickbuild_changes.py new file mode 100644 index 000000000..076163a55 --- /dev/null +++ b/scripts/quickbuild_changes.py @@ -0,0 +1,77 @@ +from pretext.project import Project +from git import Repo +from pathlib import Path +from lxml import etree +import os +import shutil +from . import preview_outcome + +def main(): + repo = Repo() + commit_head = repo.commit("HEAD") + commit_origin_main = repo.commit("origin/main") + commit_merge_base = repo.merge_base(commit_head, commit_origin_main)[0] + diff_index = commit_merge_base.diff(commit_head) + changed_files = [Path(item.a_path) for item in diff_index if not item.deleted_file and not item.renamed_file] + preview_links = [] + + p = Project.parse() + BOOKS = ['precalculus', 'calculus', 'linear-algebra'] + + # for each .ptx file, try to build subtree of document + for f in [f for f in changed_files if f.suffix == ".ptx"]: + book = None + for b in BOOKS: + b_path = Path("source") / b + if b_path in f.parents: + book = b + if book is not None: + t = p.get_target(f"{book}-web-instructor") + root = etree.parse(f).getroot() + xml_id = root.get(r"{http://www.w3.org/XML/1998/namespace}id") + print(f"Building book `{book}` with ID `{xml_id}`") + title_ele = root.find("title") + if title_ele is None: + if xml_id is None: + path = f"/preview/{book}/instructor" + else: + path = f"/preview/{book}/instructor/{xml_id}.html" + else: + path = f"/preview/{book}/instructor/{xml_id}.html" + t.build(xmlid=xml_id, no_knowls=True, generate=(xml_id is not None)) + preview_links.append({ + "file": f, + "path": path + }) + # for each CheckIt file, build its preview + for b in BOOKS: + EXERCISE_FILES = [f for f in changed_files if Path("source", b, "exercises", "outcomes") in f.parents] + # collect changed outcomes + changed_outcomes = [] + for f in EXERCISE_FILES: + if f.parent.name not in changed_outcomes: + changed_outcomes.append(f.parent.name) + # build changed outcomes + for o in changed_outcomes: + sandbox_bank_path = preview_outcome.build_preview(b, o) + output_path = Path("output", f"{b}-web-instructor", "exercises", o) + output_path.mkdir(parents=True) + shutil.copytree(sandbox_bank_path / "docs", output_path, dirs_exist_ok=True) + preview_links.append({ + "file": f, + "path": f"/preview/{b}/instructor/exercises/{o}/" + }) + + + + # create Javascript template for markdown output + markdown = f"## 🚀 Preview available 🚀\n\n<${{cf_url}}>\n\n" + for link in preview_links: + # ${{cf_url}} is provided by action Javascript + markdown += f"- \\`{link["file"]}\\`: <${{cf_url}}{link["path"]}>\n" + with open(os.environ["GITHUB_OUTPUT"], 'a') as fh: + fh.write(f"markdown< +- Lewis, D., Clontz, S., and Estis, J. (2021). Team-Based Inquiry Learning. _PRIMUS_ 31 (2), 223-238. - Team-Based Learning (TBL) is a cooperative learning strategy blending elements of flipped learning, inquiry-based learning, and problem-based learning. Although used quite frequently in other disciplines, use of this strategy in mathematics has been limited. In this article, we describe how TBL can be implemented in math courses with adherence to essential elements of TBL and introduce modifications specific to mathematics instruction. In particular, we introduce a particular style of TBL, which we term Team-Based Inquiry Learning, that satisfies the defining pillars of inquiry-based learning. -- Lewis, D. and Estis, J. 2020. Improving Mathematics Content Mastery and Enhancing Flexible Problem Solving through Team-Based Inquiry Learning. Teaching & Learning Inquiry 8 (2), 165-183. +- Lewis, D. and Estis, J. (2020). Improving Mathematics Content Mastery and Enhancing Flexible Problem Solving through Team-Based Inquiry Learning. _Teaching & Learning Inquiry_ 8 (2), 165-183. - This article examines how student learning is affected by the use of team-based inquiry learning, a novel pedagogy in mathematics that uses team-based learning to implement inquiry-based learning. We conducted quasi-experimental and observational studies in intermediate level mathematics courses, finding that team-based inquiry learning led to increased content mastery and that students took a more flexible approach to solving problems. We also found that in the courses using this pedagogy, women (but not men) had a reduction in communication apprehension over the course of a semester. We conclude that team-based inquiry learning effectively enhances student learning and problem solving, preparing students for future academic success and fostering career readiness. -- Lewis, D., Clontz, S., Parrish, C., Estis, J., and Chaudhury, S.R. To Appear. Supporting Instructors in Implementing Team-Based Inquiry Learning. Proceedings of the 26th Annual Conference on Research in Undergraduate Mathematics Education. +- Lewis, D., Clontz, S., Parrish, C., Estis, J., and Chaudhury, S.R. 2024. Supporting Instructors in Implementing Team-Based Inquiry Learning. _Proceedings of the 26th Annual Conference on Research in Undergraduate Mathematics Education_, 1152-1157. - Team-Based Inquiry Learning (TBIL) is a novel active learning pedagogy designed to facilitate the use of inquiry-based learning in lower division courses. This preliminary report examines supports provided by the TBIL project to instructors, as well as the fidelity of implementation of TBIL by participants of the project. Initial findings suggest that classroom-ready materials and ongoing support, both synchronous and asynchronous, were most helpful to faculty in their TBIL implementations. @@ -40,14 +43,21 @@ If you're planning to use TBIL in your classroom, you can get a link to join our - Kate Owens† has created [these excellent slides](https://docs.google.com/presentation/d/1824oMy2HetUVz4AlEZFufjftg72gh0Zqqu4RzOP08PE/edit?usp=sharing) overviewing TBIL and resources to implement it in your classroom. +- Drew Lewis presented a poster "[Transforming Lower Division Mathematics Through Team-Based Inquiry Learning](https://drive.google.com/file/d/1rruYnUEJKJZROXcXGkjl7aXdtc2v5FSs/view?usp=sharing)" at the IUSE Summit (June 2022) + + - Drew Lewis gave a colloquium presentation on "[Team-Based Inquiry Learning](https://drive.google.com/file/d/19zgcQU37PqaxUka8AgBL9sh2tBz2VO56/view?usp=sharing)" at the University of Tennessee Department of Mathematics (October 2022) - Kate Owens† & Abby Noble† presented "[How we juggled all the things: SBG+TBIL+CheckIt+LMS](https://docs.google.com/presentation/d/1tjZNkLplPyYpanPpkzfN0a-1n8FSTdNgMAh7RYkFFbs/edit?usp=sharing)" at the Fall 2023 Southeast Sectional Meeting of the American Mathematics Society - Jordan Kostiuk† presented on "[TBIL & Student Motivation](https://drive.google.com/file/d/1PtJmaPv24viRJPOUWGqvRu-Dx3jQvSB3/view?usp=sharing)" at the 2023 AAC&U STEM Conference +- Julie Estis presented a poster "[Transforming Lower Division Mathematics Through Team-Based Inquiry Learning: A Model for Training Faculty, Developing Resources, and Measuring Impact](https://drive.google.com/file/d/1fMj8_3Ea946Rvshmh6Z0oveKw7rk_N3c/view?usp=sharing)" at the 2023 Team-Based Learning Collaborative Annual Conference + - Manoj Lamichhane† presented "Implementation of Team Based Inquiry Learning (TBIL) in Calculus Classes at Florida Polytechnic University" at the Third International Conference on Applications of Mathematics to Nonlinear Sciences (May 2023) +- Raj Chaudhury presented a poster "[Actors, Scripts and Orchestration: a framework for understanding Team-Based Inquiry Learning](https://drive.google.com/file/d/17f2bvjhRxPK6xFbu_BemDwdKe72LKxl4/view?usp=drive_link)" at the 2023 Physics Education Research Conference. + - Francesca Gandini† & Joe Hibdon† presented "Making Student Thinking Visible with Team-Based Inquiry Learning" at the 2024 Joint Mathematics Meeting - Drew Lewis presented "[Team-Based Inquiry Learning in Lower Division Mathematics Courses](https://docs.google.com/presentation/d/11Ssh8PXw233QkBK3M17togEX0y6PE2_yaC9j4Z0OPYM/edit?usp=sharing)" at the 2024 Joint Mathematics Meeting diff --git a/source/calculus/exercises/outcomes/AD/AD5/generator.sage b/source/calculus/exercises/outcomes/AD/AD5/generator.sage index 18b1eaf88..605f2839d 100644 --- a/source/calculus/exercises/outcomes/AD/AD5/generator.sage +++ b/source/calculus/exercises/outcomes/AD/AD5/generator.sage @@ -1,21 +1,428 @@ class Generator(BaseGenerator): def data(self): - x = var("x") - a = randrange(-8,4) - b = a + randrange(2,6) - c = 3*choice([-1,1]) - derivative = expand(c*(x-a)*(x-b)) - function = integrate(derivative,x)+randrange(1,10)*choice([-1,1]) - if c > 0: - scenario = "increasing" - else: - scenario = "decreasing" - return { - "derivative": derivative, - "function": function, - "a": a, - "fa": function(x=a), - "b": b, - "fb": function(x=b), - scenario: True, - } \ No newline at end of file + + + cases = ["case1", "case2", "case3", "case4"] + + scenario = choice(cases)#"case4"# + + + if scenario == "case1": #x^3/(x+stuff)^3 + k = randrange(1,4)*choice([-1,1]) + a = 2*k^3 + c1 = randrange(1,4) + c2 = randrange(1,4) + sign = choice([-1,1]) + f(x) = c1*sign*x^3/expand(c2*(x^3-a)) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) + hasymp = c1*sign/c2 + vasymp = (a)^(1/3) + xint = 0 + yint = 0 + + + cv1 = min(0, a^(1/3)) + cv2 = max(0, a^(1/3)) + cp1 = 0 + + IP = [-1*k, 0, a^(1/3)] + IP.sort() + cc1 = IP[0] + cc2 = IP[1] + cc3 = IP[2] + ip1 = min(-1*k, 0) + ip2 = max(-1*k, 0) + + + + if sign*a^(1/3) > 0: + change1 = "decreasing" + change2 = "decreasing" + change3 = "decreasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "< 0" + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave down" + concave4 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "< 0" + sign24 = "> 0" + + if sign*a^(1/3) < 0: + change1 = "increasing" + change2 = "increasing" + change3 = "increasing" + sign11 = "> 0" + sign12 = "> 0" + sign13 = "> 0" + concave1 = "concave up" + concave2 = "concave down" + concave3 = "concave up" + concave4 = "concave down" + sign21 = "> 0" + sign22 = "< 0" + sign23 = "> 0" + sign24 = "< 0" + + return{ + scenario:True, + "case":"case1", + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "hasymp":hasymp, + "vasymp":vasymp, + "cv1":cv1, + "cv2":cv2, + "cp1":(cp1, f(cp1)), + "cc1":cc1, + "cc2":cc2, + "cc3":cc3, + "ip1":(ip1, f(ip1)), + "ip2":(ip2, f(ip2)), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "concave4":concave4, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "sign24":sign24, + "minx":-8, + "maxx":8, + "miny":-8, + "maxy":8, + "k":k, + + } + + + + + + + + + + if scenario == "case2": #x/(x^2+stuff) + k = randrange(1,4) + a = sqrt(3)*k + c1 = randrange(1,4) + c2 = randrange(1,4) + + f(x) = c1*x/expand(c2*(x^2 + a^2)) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) + + hasymp = 0 + + + + xint = 0 + yint = 0 + + + cv1 = -a + cv2 = a + cp1 = -a + cp2 = a + + cc1 = -3*k + cc2 = 0 + cc3 = 3*k + ip1 = -3*k + ip2 = 0 + ip3 = 3*k + + + + change1 = "decreasing" + change2 = "increasing" + change3 = "decreasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "< 0" + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave down" + concave4 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "< 0" + sign24 = "> 0" + + + + return{ + scenario:True, + "case":"case2", + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "hasymp":hasymp, + "cv1":cv1, + "cv2":cv2, + "cp1":(cp1, f(cp1)), + "cp2":(cp2, f(cp2)), + "cc1":cc1, + "cc2":cc2, + "cc3":cc3, + "ip1":(ip1, f(ip1)), + "ip2":(ip2, f(ip2)), + "ip3":(ip3, f(ip3)), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "concave4":concave4, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "sign24":sign24, + "minx":-40, + "maxx":40, + "miny":f(cp1)*1.2, + "maxy":f(cp2)*1.2, + "k":k, + "lb":f(cp1), + "ub":f(cp2), + + } + + + if scenario == "case3": #x/(x^2+stuff) + k = randrange(1,4) + a = sqrt(3)*k + c1 = randrange(1,4) + c2 = randrange(1,4) + + f(x) = c1*x/expand(c2*(x^2 - a^2)) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) + + hasymp = 0 + + + + xint = 0 + yint = 0 + + + cv1 = -a + cv2 = a + + cc1 = -a + cc2 = 0 + cc3 = a + ip1 = 0 + + + + change1 = "decreasing" + change2 = "decreasing" + change3 = "decreasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "< 0" + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave down" + concave4 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "< 0" + sign24 = "> 0" + + return{ + scenario:True, + "case":"case3", + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "hasymp":hasymp, + "vasymp1":-1*a, + "vasymp2":a, + "cv1":cv1, + "cv2":cv2, + "cc1":cc1, + "cc2":cc2, + "cc3":cc3, + "ip1":(0, 0), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "concave4":concave4, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "sign24":sign24, + "minx":-30, + "maxx":30, + "miny":-1, + "maxy":1, + "k":k, + "a":a, + + } + + + + + + if scenario == "case4": #x^(n+k)/n + x^k/n + n = 2*randrange(1,3)+1 + k = randrange(1,n) + sign = choice([-1,1]) + b = sign*(n+k) + + + f(x) = x^((n+k)/n) + b*x^(k/n) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) + + + xint = 0 + yint = 0 + + + parity = "odd" + + if k%2 == 1: + cv1 = min(-1*k*sign,0) + cp1 = -1*k*sign + cv2 = max(-1*k*sign,0) + cp2 = 0 + cc1 = min((n-k)*sign, 0) + cc2 = max((n-k)*sign, 0) + ip1 = (n-k)*sign + change1 = "decreasing" + change2 = "decreasing" + change3 = "increasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "> 0" + lb = f(cp1) + if sign < 0: + change1 = "decreasing" + change2 = "decreasing" + change3 = "increasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "> 0" + concave1 = "concave up" + concave2 = "concave down" + concave3 = "concave up" + sign21 = "> 0" + sign22 = "< 0" + sign23 = "> 0" + + + + if k%2 == 0: + cv1 = min(-1*k*sign, 0) + cp1 = min(-1*k*sign, 0) + cv2 = max(-1*k*sign, 0) + cp2 = max(-1*k*sign, 0) + parity = "even" + cc1 = min((n-k)*sign, 0) + cc2 = max((n-k)*sign, 0) + ip1 = (n-k)*sign + change1 = "increasing" + change2 = "decreasing" + change3 = "increasing" + sign11 = "> 0" + sign12 = "< 0" + sign13 = "> 0" + concave1 = "concave down" + concave2 = "concave down" + concave3 = "concave up" + sign21 = "< 0" + sign22 = "< 0" + sign23 = "> 0" + lb = r"-\infty" + if sign < 0: + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "> 0" + + + return{ + scenario:True, + "case":"case4", + "parity":"parity", + parity:True, + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "xint2":(-1*b, f(-1*b)), + "cp1":(cp1, f(cp1)), + "cp2":(cp2, f(cp2)), + "cv1":cv1, + "cv2":cv2, + "cc1":cc1, + "cc2":cc2, + "ip1":(ip1, f(ip1)), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "minx":-10, + "maxx":10, + "miny":min(f(ip1),0)-10, + "maxy":max(f(ip1),0)+10, + "k":k, + "lb":lb, + "sign":sign, + "n":n, + "b":b, + + } + + + + + + + + + diff --git a/source/calculus/exercises/outcomes/AD/AD5/template.xml b/source/calculus/exercises/outcomes/AD/AD5/template.xml index 8ad7dc7ad..a111c3887 100644 --- a/source/calculus/exercises/outcomes/AD/AD5/template.xml +++ b/source/calculus/exercises/outcomes/AD/AD5/template.xml @@ -2,55 +2,69 @@

-Explain how to find the following for the function f(x)={{function}}. + For \displaystyle f(x) = {{f}} , identify the regions for which f(x) is increasing and decreasing (if any). Additionally, identify and classify all local extrema.

- - -

-The open intervals where f(x) is increasing or decreasing. -

-
- - -

-The function increases on (-\infty,{{a}}), -decreases on ({{a}},{{b}}), and increases on -({{b}},\infty). -

-
- - - -

-The function decreases on (-\infty,{{a}}), -increases on ({{a}},{{b}}), and decreases on -({{b}},\infty). -

-
- -
- - -

-The local extrema of f(x). -

-
- - -

-The point (x,y)=({{a}},{{fa}}) is a local maximum, -and the point (x,y)=({{b}},{{fb}}) is a local minimum. -

-
- - - -

-The point (x,y)=({{a}},{{fa}}) is a local minimum, -and the point (x,y)=({{b}},{{fb}}) is a local maximum. -

-
- -
-
\ No newline at end of file + + + +

+ We have that \displaystyle f'(x) = {{fp}}. + When x < {{cv1}}, f'(x) {{sign11}} and y is {{change1}}. + When {{cv1}} < x < {{cv2}}, f'(x) {{sign12}} and y is {{change2}}. + When {{cv2}} < x, f'(x) {{sign13}} and y is {{change3}}. There is a critical point {{cp1}} which is neither a max nor min. +

+ + + + +

+ We have that \displaystyle f'(x) = {{fp}}. + When x < {{cv1}}, f'(x) {{sign11}} and y is {{change1}}. + When {{cv1}} < x < {{cv2}}, f'(x) {{sign12}} and y is {{change2}}. + When {{cv2}} < x, f'(x) {{sign13}} and y is {{change3}}. There is a critical point {{cp1}} which is a local minimum and a critical point {{cp2}} is a local maximum. +

+ + + + +

+ We have that \displaystyle f'(x) = {{fp}}. + When x < {{cv1}}, f'(x) {{sign11}} and y is {{change1}}. + When {{cv1}} < x < {{cv2}}, f'(x) {{sign12}} and y is {{change2}}. + When {{cv2}} < x, f'(x) {{sign13}} and y is {{change3}}. There are no critical points. +

+ + + + + + +

+ We have that \displaystyle f'(x) = {{fp}}. + When x < {{cv1}}, f'(x) {{sign11}} and y is {{change1}}. + When {{cv1}} < x < {{cv2}}, f'(x) {{sign12}} and y is {{change2}}. + When {{cv2}} < x, f'(x) {{sign13}} and y is {{change3}}. There is a critical point {{cp1}} which is a local minimum. +

+ + +

+ We have that \displaystyle f'(x) = {{fp}}. + When x < {{cv1}}, f'(x) {{sign11}} and y is {{change1}}. + When {{cv1}} < x < {{cv2}}, f'(x) {{sign12}} and y is {{change2}}. + When {{cv2}} < x, f'(x) {{sign13}} and y is {{change3}}. There are critical points {{cp1}} which is a local maximum and {{cp2}} which is a local minimum. +

+ + + + + + + + + + +
+ + + diff --git a/source/calculus/exercises/outcomes/AD/AD6/generator.sage b/source/calculus/exercises/outcomes/AD/AD6/generator.sage index a543241d5..c3e5ec212 100644 --- a/source/calculus/exercises/outcomes/AD/AD6/generator.sage +++ b/source/calculus/exercises/outcomes/AD/AD6/generator.sage @@ -1,119 +1,423 @@ class Generator(BaseGenerator): def data(self): - x = var("x") - negative=choice([-1,1]) - def concavity_from_sign(sgn): - if sgn<0: - return "down" - elif sgn>0: - return "up" - else: - return "unknown" + + + cases = ["case1", "case2", "case3", "case4"] + + scenario = choice(cases)#"case4"# + + + if scenario == "case1": #x^3/(x+stuff)^3 + k = randrange(1,4)*choice([-1,1]) + a = 2*k^3 + c1 = randrange(1,4) + c2 = randrange(1,4) + sign = choice([-1,1]) + f(x) = c1*sign*x^3/expand(c2*(x^3-a)) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) + hasymp = c1*sign/c2 + vasymp = (a)^(1/3) + xint = 0 + yint = 0 + + + cv1 = min(0, a^(1/3)) + cv2 = max(0, a^(1/3)) + cp1 = 0 + + IP = [-1*k, 0, a^(1/3)] + IP.sort() + cc1 = IP[0] + cc2 = IP[1] + cc3 = IP[2] + ip1 = min(-1*k, 0) + ip2 = max(-1*k, 0) + + + + if sign*a^(1/3) > 0: + change1 = "decreasing" + change2 = "decreasing" + change3 = "decreasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "< 0" + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave down" + concave4 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "< 0" + sign24 = "> 0" + + if sign*a^(1/3) < 0: + change1 = "increasing" + change2 = "increasing" + change3 = "increasing" + sign11 = "> 0" + sign12 = "> 0" + sign13 = "> 0" + concave1 = "concave up" + concave2 = "concave down" + concave3 = "concave up" + concave4 = "concave down" + sign21 = "> 0" + sign22 = "< 0" + sign23 = "> 0" + sign24 = "< 0" + + return{ + scenario:True, + "case":"case1", + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "hasymp":hasymp, + "vasymp":vasymp, + "cv1":cv1, + "cv2":cv2, + "cp1":(cp1, f(cp1)), + "cc1":cc1, + "cc2":cc2, + "cc3":cc3, + "ip1":(ip1, f(ip1)), + "ip2":(ip2, f(ip2)), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "concave4":concave4, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "sign24":sign24, + "minx":-8, + "maxx":8, + "miny":-8, + "maxy":8, + "k":k, + + } + + + + + + + + + + if scenario == "case2": #x/(x^2+stuff) + k = randrange(1,4) + a = sqrt(3)*k + c1 = randrange(1,4) + c2 = randrange(1,4) + + f(x) = c1*x/expand(c2*(x^2 + a^2)) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) - zeros = [ - -randrange(1,6), - 0, - randrange(1,6), - ] - fpp = prod([x-z for z in zeros])*negative*randrange(3,6) - f = integrate(integrate(fpp,x),x) - data = [ - { - "interval": f"(-\\infty, {zeros[0]} )", - "concavity": concavity_from_sign(-negative), - }, - { - "point": zeros[0], - "inflection": True, - }, - { - "interval": f"( {zeros[0]} , {zeros[1]} )", - "concavity": concavity_from_sign(negative), - }, - { - "point": zeros[1], - "inflection": True, - }, - { - "interval": f"( {zeros[1]} , {zeros[2]} )", - "concavity": concavity_from_sign(-negative), - }, - { - "point": zeros[2], - "inflection": True, - }, - { - "interval": f"( {zeros[2]} , \\infty )", - "concavity": concavity_from_sign(negative), - }, - ] - fs = [ - { - "f":f, - "fpp":fpp, - "data":data, + hasymp = 0 + + + + xint = 0 + yint = 0 + + + cv1 = -a + cv2 = a + cp1 = -a + cp2 = a + + cc1 = -3*k + cc2 = 0 + cc3 = 3*k + ip1 = -3*k + ip2 = 0 + ip3 = 3*k + + + + change1 = "decreasing" + change2 = "increasing" + change3 = "decreasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "< 0" + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave down" + concave4 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "< 0" + sign24 = "> 0" + + + + return{ + scenario:True, + "case":"case2", + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "hasymp":hasymp, + "cv1":cv1, + "cv2":cv2, + "cp1":(cp1, f(cp1)), + "cp2":(cp2, f(cp2)), + "cc1":cc1, + "cc2":cc2, + "cc3":cc3, + "ip1":(ip1, f(ip1)), + "ip2":(ip2, f(ip2)), + "ip3":(ip3, f(ip3)), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "concave4":concave4, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "sign24":sign24, + "minx":-40, + "maxx":40, + "miny":f(cp1)*1.2, + "maxy":f(cp2)*1.2, + "k":k, + "lb":f(cp1), + "ub":f(cp2), + } - ] + + + if scenario == "case3": #x/(x^2+stuff) + k = randrange(1,4) + a = sqrt(3)*k + c1 = randrange(1,4) + c2 = randrange(1,4) + + f(x) = c1*x/expand(c2*(x^2 - a^2)) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) - double_root = randrange(1,6)*choice([-1,1]) - fpp = x*(x-double_root)^2*negative*randrange(3,6) - if double_root < 0: - data = [ - { - "interval": f"(-\\infty, {double_root} )", - "concavity": concavity_from_sign(-negative), - }, - { - "point": double_root, - "inflection": False, - }, - { - "interval": f"( {double_root} , 0 )", - "concavity": concavity_from_sign(-negative), - }, - { - "point": 0, - "inflection": True, - }, - { - "interval": f"( 0, \\infty )", - "concavity": concavity_from_sign(negative), - }, - ] - else: - data = [ - { - "interval": f"(-\\infty, 0 )", - "concavity": concavity_from_sign(-negative), - }, - { - "point": 0, - "inflection": True, - }, - { - "interval": f"( 0, {double_root} )", - "concavity": concavity_from_sign(negative), - }, - { - "point": double_root, - "inflection": False, - }, - { - "interval": f"( {double_root} , \\infty )", - "concavity": concavity_from_sign(negative), - }, - ] - f = integrate(integrate(fpp,x),x) - fs.append( - { - "f":f, - "fpp":fpp, - "data":data, + hasymp = 0 + + + + xint = 0 + yint = 0 + + + cv1 = -a + cv2 = a + + cc1 = -a + cc2 = 0 + cc3 = a + ip1 = 0 + + + + change1 = "decreasing" + change2 = "decreasing" + change3 = "decreasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "< 0" + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave down" + concave4 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "< 0" + sign24 = "> 0" + + return{ + scenario:True, + "case":"case3", + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "hasymp":hasymp, + "vasymp1":-1*a, + "vasymp2":a, + "cv1":cv1, + "cv2":cv2, + "cc1":cc1, + "cc2":cc2, + "cc3":cc3, + "ip1":(0, 0), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "concave4":concave4, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "sign24":sign24, + "minx":-30, + "maxx":30, + "miny":-1, + "maxy":1, + "k":k, + "a":a, + + } + + + + + + if scenario == "case4": #x^(n+k)/n + x^k/n + n = 2*randrange(1,3)+1 + k = randrange(1,n) + sign = choice([-1,1]) + b = sign*(n+k) + + + f(x) = x^((n+k)/n) + b*x^(k/n) + fp(x) = f(x).derivative(x) + fpp(x) = f(x).derivative(x,2) + + + xint = 0 + yint = 0 + + + parity = "odd" + + if k%2 == 1: + cv1 = min(-1*k*sign,0) + cp1 = -1*k*sign + cv2 = max(-1*k*sign,0) + cp2 = 0 + cc1 = min((n-k)*sign, 0) + cc2 = max((n-k)*sign, 0) + ip1 = (n-k)*sign + change1 = "decreasing" + change2 = "decreasing" + change3 = "increasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "> 0" + lb = f(cp1) + if sign < 0: + change1 = "decreasing" + change2 = "decreasing" + change3 = "increasing" + sign11 = "< 0" + sign12 = "< 0" + sign13 = "> 0" + concave1 = "concave up" + concave2 = "concave down" + concave3 = "concave up" + sign21 = "> 0" + sign22 = "< 0" + sign23 = "> 0" + + + + if k%2 == 0: + cv1 = min(-1*k*sign, 0) + cp1 = min(-1*k*sign, 0) + cv2 = max(-1*k*sign, 0) + cp2 = max(-1*k*sign, 0) + parity = "even" + cc1 = min((n-k)*sign, 0) + cc2 = max((n-k)*sign, 0) + ip1 = (n-k)*sign + change1 = "increasing" + change2 = "decreasing" + change3 = "increasing" + sign11 = "> 0" + sign12 = "< 0" + sign13 = "> 0" + concave1 = "concave down" + concave2 = "concave down" + concave3 = "concave up" + sign21 = "< 0" + sign22 = "< 0" + sign23 = "> 0" + lb = r"-\infty" + if sign < 0: + concave1 = "concave down" + concave2 = "concave up" + concave3 = "concave up" + sign21 = "< 0" + sign22 = "> 0" + sign23 = "> 0" + + + return{ + scenario:True, + "case":"case4", + "parity":"parity", + parity:True, + "f":f(x), + "fp":factor(fp(x)), + "fpp":factor(fpp(x)), + "xint":(xint, f(xint)), + "yint":(yint, f(yint)), + "xint2":(-1*b, f(-1*b)), + "cp1":(cp1, f(cp1)), + "cp2":(cp2, f(cp2)), + "cv1":cv1, + "cv2":cv2, + "cc1":cc1, + "cc2":cc2, + "ip1":(ip1, f(ip1)), + "change1":change1, + "change2":change2, + "change3":change3, + "sign11":sign11, + "sign12":sign12, + "sign13":sign13, + "concave1":concave1, + "concave2":concave2, + "concave3":concave3, + "sign21":sign21, + "sign22":sign22, + "sign23":sign23, + "minx":-10, + "maxx":10, + "miny":min(f(ip1),0)-10, + "maxy":max(f(ip1),0)+10, + "k":k, + "lb":lb, + "sign":sign, + "n":n, + "b":b, + } - ) - - shuffle(fs) return { "fs": fs, - } \ No newline at end of file + } diff --git a/source/calculus/exercises/outcomes/AD/AD6/template.xml b/source/calculus/exercises/outcomes/AD/AD6/template.xml index e08324f48..4581f3b0a 100644 --- a/source/calculus/exercises/outcomes/AD/AD6/template.xml +++ b/source/calculus/exercises/outcomes/AD/AD6/template.xml @@ -1,42 +1,60 @@ -

-For each of the following functions, describe the open intervals -where it is concave up or concave down, and any inflection points. + For \displaystyle f(x) = {{f}} , identify the regions where f(x) is concave up and concave down (if any) as well as all inflection points.

- - - -

f(x)={{f}}

-
- -

f''(x)={{fpp}}

- - - - -

-{{interval}} is concave {{concavity}} -

-
- - - -

-{{point}} -{{#inflection}}is{{/inflection}} -{{^inflection}}is not{{/inflection}} -an inflection point -

-
- - -
-
-
- -
\ No newline at end of file + + + +

+ We have that \displaystyle f''(x) = {{fpp}}. + When x < {{cc1}}, f''(x) {{sign21}} and y is {{concave1}}. + When {{cc1}} < x < {{cc2}}, f''(x) {{sign22}} and y is {{concave2}}. + When {{cc2}} < x < {{cc3}}, f''(x) {{sign23}} and y is {{concave3}}. + When {{cc3}} < x, f''(x) {{sign24}} and y is {{change4}}. There are inflection points {{ip1}} and {{ip2}}. +

+ + + +

+ We have that \displaystyle f''(x) = {{fpp}}. + When x < {{cc1}}, f''(x) {{sign21}} and y is {{concave1}}. + When {{cc1}} < x < {{cc2}}, f''(x) {{sign22}} and y is {{concave2}}. + When {{cc2}} < x < {{cc3}}, f''(x) {{sign23}} and y is {{concave3}}. + When {{cc3}} < x, f''(x) {{sign24}} and y is {{change4}}. There are inflection points {{ip1}}, {{ip2}} and {{ip3}}. +

+ + + + +

+ We have that \displaystyle f''(x) = {{fpp}}. + When x < {{cc1}}, f''(x) {{sign21}} and y is {{concave1}}. + When {{cc1}} < x < {{cc2}}, f''(x) {{sign22}} and y is {{concave2}}. + When {{cc2}} < x < {{cc3}}, f''(x) {{sign23}} and y is {{concave3}}. + When {{cc3}} < x, f''(x) {{sign24}} and y is {{change4}}. There is an inflection point {{ip1}}. +

+ + + + + +

+ We have that \displaystyle f''(x) = {{fpp}}. + When x < {{cc1}}, f''(x) {{sign21}} and y is {{concave1}}. + When {{cc1}} < x < {{cc2}}, f''(x) {{sign22}} and y is {{concave2}}. + When {{cc2}} < x, f''(x) {{sign23}} and y is {{concave3}}. + There is an inflection point {{ip1}}. +

+ + + + + + +
+ + + diff --git a/source/calculus/exercises/outcomes/AI/AI3/generator.sage b/source/calculus/exercises/outcomes/AI/AI3/generator.sage index bc99e0174..411bd283d 100644 --- a/source/calculus/exercises/outcomes/AI/AI3/generator.sage +++ b/source/calculus/exercises/outcomes/AI/AI3/generator.sage @@ -1,63 +1,255 @@ class Generator(BaseGenerator): def data(self): - x=var("x") - y=var("y") + var("x, y") from sage.symbolic.integration.integral import definite_integral + a = randrange(-15,0) + b = randrange(1,16) + h=101 + scenario = randrange(4) - scenario=randint(0,3) - if scenario==0: - m=randint(1,6)/2 - b=randint(0,3) - f(x)=m*x+b - g(y)=(y-b)/m + if scenario == 0: - if scenario==1: - m=randint(1,6)/2 - b=0 - f(x)=m*x^2+b - g(y)=sqrt((y-b)/m) + h=100 + while( not(a<-h/2 q(a+1): + big(y) = l(y) + small(y) = q(y) + else: + big(y) = q(y) + small(y) = l(y) + case = randrange(0,2) + if case == 0: + xline = x1 - randrange(1,6) + yline = b + randrange(1,6) + F1(x) = yline - f2(x) + F2(x) = yline - f1(x) + G1(x) = yline - g2(x) + G2(x) = yline - g1(x) + radiusy = yline - y + radiusx = x - xline + Big(y) = expand(big(y)) - xline + Small(y) = expand(small(y)) - xline + if case == 1: + xline = x3 + randrange(1,6) + yline = a - randrange(1,6) + F1(x) = f1(x) - yline + F2(x) = f2(x) - yline + G1(x) = g1(x) - yline + G2(x) = g2(x) - yline + radiusy = y - yline + radiusx = xline - x + Big(y) = xline - expand(small(y)) + Small(y) = xline - expand(big(y)) - + return { + "line": simplify((x-bint)/m), + "quad":expand( q(y) ), + "a":a, + "b":b, + "v":v, + "vy":-h/2, + "ax":l(a), + "bx":l(b), + "x1":x1, + "x2":x2, + "x3":x3, + "f1":f1(x), + "f2":f2(x), + "f":simplify(f1(x)-f2(x)), + "g1":g1(x), + "g2":g2(x), + "g":simplify(g1(x)-g2(x)), + "left":expand(left), + "right":expand(right), + "poly":expand(right-left), + "leftg":l(y)-x, + "rightg":q(y)-x, + "low":a-1, + "high":b+1, + "small":x1-1, + "big":x3+1, + "xline": xline, + "yline": yline, + "F1": F1(x), + "F2": F2(x), + "G1": G1(x), + "G2": G2(x), + "radiusy": radiusy, + "radiusx": radiusx, + "Big": Big(y), + "Small": Small(y), + + } + + + + + @provide_data + def graphics(data): + # updated by clontz - - + minx = min(data['small'], data['big'], data['xline'])-1 + maxx = max(data['small'], data['big'], data['xline'])+1 + miny = min(data['low'], data['high'], data['yline'])-1 + maxy = max(data['low'], data['high'], data['yline'])+1 + + return {"region": implicit_plot(data['leftg'],(x,minx,maxx),(y,miny,maxy), axes=True) + +implicit_plot(data['rightg'],(x,minx,maxx),(y,miny,maxy), axes=True,) + +point((data['ax'], data['a']),size=30, color='green') + +line([(data['xline'],miny), (data['xline'],maxy)], linestyle = "dashed", color = 'orange') + +line([(minx, data['yline']), (maxx, data['yline'])], linestyle = "dashed", color = 'red') + +text(' $(%s,%s)$'%(data['ax'],data['a']),(data['ax'], data['a']),horizontal_alignment="left",vertical_alignment="top", color='green')+point((data['bx'], data['b']),size=30, color='green') + +text(' $(%s,%s)$'%(data['bx'],data['b']),(data['bx'], data['b']),horizontal_alignment="left",vertical_alignment="top", color='green') + +point((data['v'], data['vy']),size=30, color='violet') + +text(' $(%s,%s)$'%(data['v'],data['vy']),(data['v'], data['vy']),horizontal_alignment="left",vertical_alignment="top", color='violet') + } - - return { - "f": f(x), - "g": g(y), - "a": a, - "b": b, - "low": low, - "high": high, - } diff --git a/source/calculus/exercises/outcomes/AI/AI3/template.xml b/source/calculus/exercises/outcomes/AI/AI3/template.xml index fadecfd08..6d50e6b9d 100644 --- a/source/calculus/exercises/outcomes/AI/AI3/template.xml +++ b/source/calculus/exercises/outcomes/AI/AI3/template.xml @@ -1,21 +1,80 @@ + +

- Consider the region bounded by y={{ f }}, y=0, x={{a}}, x={{b}}. + Consider the region \mathbf{R} bound by the curves y={{line}}, x={{quad}}, as well as the lines x={{xline}}, y={{yline}}

-
+ + + + +

+ Sketch the region \mathbf{R} and the two lines. +

+
+ +

+ +

+
+
+ + + +

+ Consider the solid of revolution generated by rotating \mathbf{R} across y={{yline}}. Express this volume as a (sum of) integral(s) with respect to x. +

+
+ +

+ The volume is expressible as \int_{ {{x1}} }^{ {{x2}} } \pi\left( {{F1}} \right)^2 - \pi\left( {{F2}} \right)^2dx +\int_{ {{x2}} }^{ {{x3}} } \pi\left( {{G1}} \right)^2 - \pi\left( {{G2}} \right)^2dx. +

+
+
-

Find an integral or sum of integrals which computes the volume of the solid formed by rotating this region about the x-axis.

-

Using the washer/disk method, we obtain \int_{ {{a}} }^{ {{b}} } \pi \left({{f}}\right)^2dx and using the shell method, we obtain - \int_0^{ {{low}} } 2\pi y\left( {{b}}-{{a}}\right)dy +\int_{ {{low}} }^{ {{high}} } 2\pi y\left( {{b}}-\left({{g}}\right)\right)dy.

+ +

+ Consider the solid of revolution generated by rotating \mathbf{R} across y={{yline}}. Express this volume as a (sum of) integral(s) with respect to y. +

+
+ +

+ The volume is expressible as \int_{ {{a}} }^{ {{b}} } 2\pi\left( {{poly}} \right)({{radiusy}})dy +

+
- -

Find an integral or sum of integrals which computes the volume of the solid formed by rotating this region about the y-axis.

-

Using the washer/disk method, we obtain - \int_0^{ {{low}} } \pi\left({{b}}^2-{{a}}^2\right)dy + \int_{ {{low}} }^{ {{high}} } \pi\left({{b}}^2-\left({{g}}\right)^2\right)dy and using the shell method, we obtain - \int_{ {{a}} }^{ {{b}} }2\pi x \left({{f}}\right)dx.

-
+ + + +

+ Consider the solid of revolution generated by rotating \mathbf{R} across x={{xline}}. Express this volume as a (sum of) integral(s) with respect to x. +

+
+ +

+ The volume is expressible as = \int_{ {{x1}} }^{ {{x2}} } 2\pi\left( {{f}} \right)({{radiusx}})dx +\int_{ {{x2}} }^{ {{x3}} } 2\pi\left( {{g}} \right)({{radiusx}})dx. +

+
+ + + +

+ Consider the solid of revolution generated by rotating \mathbf{R} across x={{xline}}. Express this volume as a (sum of) integral(s) with respect to y. +

+
+ +

+ The volume is expressible as \int_{ {{a}} }^{ {{b}} } \pi\left(\left( {{Big}} \right)^2 - \left({{Small}}\right)^2\right)dy +

+
+
+ + +
diff --git a/source/calculus/exercises/outcomes/AI/AI5/generator.sage b/source/calculus/exercises/outcomes/AI/AI5/generator.sage index abc0f32a9..c152a2700 100644 --- a/source/calculus/exercises/outcomes/AI/AI5/generator.sage +++ b/source/calculus/exercises/outcomes/AI/AI5/generator.sage @@ -13,26 +13,26 @@ class Generator(BaseGenerator): d(h)=randint(10, 30)/20*h+randint(1,5) - scenario=randint(0,3) + scenario=randint(0,1) - if scenario==0: - solid="rectangular prism" - base="sqaure" - measuretype="side length" - b=randint(5,10) - height=randint(1,5)*5 - A(h)=b^2 + #if scenario==0: + # solid="rectangular prism" + # base="sqaure" + # measuretype="side length" + # b=randint(5,10) + # height=randint(1,5)*5 + # A(h)=b^2 - if scenario==1: - solid="cylinder" - base="circular" - measuretype="radius" - b=randint(2,6) - height=randint(1,5)*5 - A(h)=pi*b^2 + #if scenario==1: + # solid="cylinder" + # base="circular" + # measuretype="radius" + # b=randint(2,6) + # height=randint(1,5)*5 + # A(h)=pi*b^2 - if scenario==2: + if scenario==0: solid="pyramid" base="square" measuretype="side length" @@ -40,7 +40,7 @@ class Generator(BaseGenerator): height=randint(1,5)*5 A(h)=(b*(1-h/height))^2 - if scenario==3: + if scenario==1: solid="cone" base="circular" measuretype="radius" diff --git a/source/calculus/exercises/outcomes/LT/LT1/template.xml b/source/calculus/exercises/outcomes/LT/LT1/template.xml index fe2f7b120..f78b343d8 100644 --- a/source/calculus/exercises/outcomes/LT/LT1/template.xml +++ b/source/calculus/exercises/outcomes/LT/LT1/template.xml @@ -84,10 +84,10 @@ Sketch the graph of a function {{fn}}(x) that meets all of the following -

There is a jump or infinite discontinuity at x={{x}}, but the function approaches the point ({{x}},{{y1}}) as x approaches {{x}} from the left.

+

There is a jump or infinite discontinuity at x={{x}}, but the function approaches the point ({{x}},{{y1}}) as x approaches {{x}} from the left, but a different value from the right.

-

There is a jump or infinite discontinuity at x={{x}}, but the function approaches the point ({{x}},{{y1}}) as x approaches {{x}} from the right.

+

There is a jump or infinite discontinuity at x={{x}}, but the function approaches the point ({{x}},{{y1}}) as x approaches {{x}} from the right, but a different value from the left.

There is a jump discontinuity at x={{x}} with the graph approaching the point ({{x}},{{y1}}) as x approaches {{x}} from the left and approaching the point ({{x}},{{y2}}) as x approaches {{x}} from the right.

diff --git a/source/calculus/exercises/outcomes/TI/TI3/generator.sage b/source/calculus/exercises/outcomes/TI/TI3/generator.sage index 0c92a0cd8..e2afa39d5 100644 --- a/source/calculus/exercises/outcomes/TI/TI3/generator.sage +++ b/source/calculus/exercises/outcomes/TI/TI3/generator.sage @@ -1,32 +1,50 @@ +#Functions to display powers of trig functions +def print_cosp(self,*args): return f"\\cos ^{{{args[1]}}}({latex(args[0])})" +def deriv_cosp(self,*args,**kwds): + if args[1]==1: + return -1*sinp(args[0],1)*args[0].derivative(args[kwds['diff_param']]) + else: + return args[1]*-1*cosp(args[0],args[1]-1)*sinp(args[0],1)*args[0].derivative(args[kwds['diff_param']]) + +cosp = function("cosp",nargs=2,print_latex_func=print_cosp,derivative_func=deriv_cosp) +def print_sinp(self,*args): return f"\\sin ^{{{args[1]}}}({latex(args[0])})" +def deriv_sinp(self,*args,**kwds): + if args[1]==1: + return cosp(args[0],1)*args[0].derivative(args[kwds['diff_param']]) + else: + return args[1]*sinp(args[0],args[1]-1)*cosp(args[0],1)*args[0].derivative(args[kwds['diff_param']]) + +sinp = function("sinp",nargs=2,print_latex_func=print_sinp, derivative_func=deriv_sinp) + class Generator(BaseGenerator): + def data(self): - # integral with odd power + # Task 1, integral with odd power x=var("x") - even=2*randint(1,6) - - odd=choice([5,7]) + n=randint(1,6) + m=randint(2,3) - z = var("z") - if odd==5: - hint = "hint_2" - else: - hint = "hint_3" + k=var('k') + z=var('z') + hint=f"(1-z)^{m}={latex(sum(binomial(m,k)*(-z)^k,k,0,m))}" - trigs=[sin, cos] - shuffle(trigs) - f=randint(1,5)*(trigs[0](x))^even*(trigs[1](x))^odd + trigs=[sinp, cosp] + shuffle(trigs) - F=f.integral(x) + a = randint(1,6) + f = a*trigs[0](x,2*n)*trigs[1](x,2*m+1) + F = sum(a*binomial(m,k)*(-1)^k*1/(2*n+2*k+1)*trigs[0](x,2*n+2*k+1)*trigs[0](x,1).derivative(x)/trigs[1](x,1),k,0,m) + - # integral with even powers + # Task 2, integral with even powers a = randrange(2,6) m = randrange(2,5) n = randrange(2,5) k = 2^randrange(2,5) - g = k*cos(a*x)^(2*m)*sin(a*x)^(2*n) + g = k*cosp(a*x,2*m)*sinp(a*x,2*n) also_g = k/2^(m+n)*(1+cos(2*a*x))^m*(1-cos(2*a*x))^n @@ -35,5 +53,5 @@ class Generator(BaseGenerator): "F": F, "g": g, "also_g": also_g, - hint: True, + "hint": hint, } diff --git a/source/calculus/exercises/outcomes/TI/TI3/template.xml b/source/calculus/exercises/outcomes/TI/TI3/template.xml index 0377ef9f6..783f780d2 100644 --- a/source/calculus/exercises/outcomes/TI/TI3/template.xml +++ b/source/calculus/exercises/outcomes/TI/TI3/template.xml @@ -3,14 +3,8 @@

-Use trigonometric identities and -{{#hint_2}} -(1-z)^2=1-2z+z^2 -{{/hint_2}} -{{#hint_3}} -(1-z)^3=1-3z+3z^2-z^3 -{{/hint_3}} -to explain and demonstrate how to find +Using trigonometric identities and the fact that {{hint}}, +explain and demonstrate how to find \displaystyle \int {{f}} dx.

@@ -24,8 +18,8 @@ to explain and demonstrate how to find

Explain and demonstrate how to use double-angle identities to -rewrite \displaystyle \int {{g}} dx. (Do not solve the -rewritten integral.) +rewrite \displaystyle \int {{g}} dx into a form +with smaller exponents. (Do not solve the rewritten integral.)

@@ -34,4 +28,4 @@ rewritten integral.)

-
\ No newline at end of file + diff --git a/source/calculus/exercises/outcomes/TI/TI4/template.xml b/source/calculus/exercises/outcomes/TI/TI4/template.xml index 6528e6f92..04d31656d 100644 --- a/source/calculus/exercises/outcomes/TI/TI4/template.xml +++ b/source/calculus/exercises/outcomes/TI/TI4/template.xml @@ -9,7 +9,8 @@ Consider these given integrals of trigonometric functions.

\int \tan^2\theta\,d\theta=\tan\theta-\theta+C

-

\int \sec\theta\,d\theta= +

\renewcommand{\log}{\ln} + \int \sec\theta\,d\theta= \log|\sec\theta+\tan\theta|+C

@@ -29,13 +30,15 @@ integrals to find each of the following.

-\int {{integrand}}\,dx +\renewcommand{\log}{\ln} + \int {{integrand}}\,dx

-Substitute {{sub}} to find - +Substitute \renewcommand{\log}{\ln} + {{sub}} to find + \renewcommand{\log}{\ln} \int {{integrand}}\,dx = {{result}} +C diff --git a/source/calculus/exercises/outcomes/TI/TI8/generator.sage b/source/calculus/exercises/outcomes/TI/TI8/generator.sage index 0d4f232a3..70c1cee80 100644 --- a/source/calculus/exercises/outcomes/TI/TI8/generator.sage +++ b/source/calculus/exercises/outcomes/TI/TI8/generator.sage @@ -1,49 +1,99 @@ class Generator(BaseGenerator): def data(self): + from sage.symbolic.integration.integral import definite_integral + x=var("x") tasks = [] - bs = sample([choice([-1,1])*n for n in range(2,10)],4) + bs = sample([choice([-1,1])*n for n in range(2,10)],5) + + coeff = [2,3,4,5,6,7,8] + + case1 = choice([0,1]) # converges with infinite bound - p = randrange(3,10) - q = randrange(2,p) - tasks.append({ - "integrand": 1/(x-bs[0])^(SR(p)/q), - "converges": True, - "top": oo, - "bottom": bs[0]+randrange(1,6), - }) + if case1 == 0: + p = randrange(3,10) + q = randrange(3,10) + bottom = bs[0] + randrange(1,6) + shuffle(coeff) + antidiff(x) = -1*(coeff[0]/coeff[1])/(x-bs[0])^(SR(p)/q) + tasks.append({ + "integrand": antidiff(x).diff(x), + "converges": True, + "top": oo, + "bottom": bottom, + "proper": False, + "improper": True, + "int": 0-antidiff(bottom), + }) # diverges with infinite bound - p = randrange(2,9) - q = randrange(p+1,10) - tasks.append({ - "integrand": 1/(x-bs[1])^(SR(p)/q), - "converges": False, - "top": oo, - "bottom": bs[1]+randrange(1,6), - }) + if case1 == 1: + p = randrange(1,5) + q = randrange(p+1,p+5) + bottom = bs[1]+randrange(1,6) + shuffle(coeff) + antidiff(x) = choice([(coeff[0]/coeff[1])*(x-bs[1])^(SR(p)/q), (coeff[0]/coeff[1])*log(x-bs[1]) ]) + tasks.append({ + "integrand": antidiff(x).diff(x), + "converges": False, + "top": oo, + "bottom": bottom, + "proper": False, + "improper": True, + "int": r"\infty", + }) # converges with finite bounds - p = randrange(2,9) - q = randrange(p+1,10) - tasks.append({ - "integrand": 1/(x-bs[2])^(SR(p)/q), - "converges": True, - "top": bs[2]+randrange(1,6), - "bottom": bs[2], - }) + if case1 == 1: + case1 = randrange(0,2) + p = randrange(1,5) + q = randrange(p+1,p+5) + top = bs[2]+randrange(1,6) + shuffle(coeff) + antidiff(x) = (coeff[0]/coeff[1])*(x-bs[2])^(SR(p)/q) + tasks.append({ + "integrand": antidiff(x).diff(x), + "converges": True, + "top": top, + "bottom": bs[2], + "proper": False, + "improper": True, + "int": antidiff(top), + }) # diverges with finite bounds + if case1 == 0: + p = randrange(3,10) + q = randrange(3,10) + top = bs[3]+randrange(1,6) + shuffle(coeff) + antidiff(x) = choice([-1*(coeff[0]/coeff[1])/(x-bs[3])^(SR(p)/q), (coeff[0]/coeff[1])*log(x-bs[3]) ]) + tasks.append({ + "integrand": 1/(x-bs[3])^(SR(p)/q), + "converges": False, + "top": top, + "bottom": bs[3], + "proper": False, + "improper": True, + "int": r"\infty", + }) + + + # proper p = randrange(3,10) - q = randrange(2,p) + q = randrange(3,10) + bottom = bs[4]+randrange(1,6) + top = bottom + randrange(1,6) tasks.append({ - "integrand": 1/(x-bs[3])^(SR(p)/q), - "converges": False, - "top": bs[3]+randrange(1,6), - "bottom": bs[3], - }) + "integrand": 1/(x-bs[4])^(SR(p)/q), + "converges": True, + "top": top, + "bottom": bottom, + "proper": True, + "improper": False, + }) shuffle(tasks) diff --git a/source/calculus/exercises/outcomes/TI/TI8/template.xml b/source/calculus/exercises/outcomes/TI/TI8/template.xml index 0ce9edbb4..b18aca560 100644 --- a/source/calculus/exercises/outcomes/TI/TI8/template.xml +++ b/source/calculus/exercises/outcomes/TI/TI8/template.xml @@ -2,20 +2,19 @@

-Explain and demonstrate how to write each of the following improper integrals -as a limit, and why this limit converges or diverges. +For each of the following integrals, identify if the integral is proper or improper. If improper, then compute the integral by finding the antiderivative, using the fundamental theorem of calculus, and computing the limit.

-

\displaystyle\int_{ {{bottom}} }^{ {{top}} } {{integrand}} dx.

+

\renewcommand{\log}{\ln} \displaystyle\int_{ {{bottom}} }^{ {{top}} } {{integrand}} dx.

- -

Converges.

- - -

Diverges.

- + +

This integral is proper.

+ + +

\renewcommand{\log}{\ln} \displaystyle\int_{ {{bottom}} }^{ {{top}} } {{integrand}} dx = {{int}}.

+
diff --git a/source/calculus/source/01-LT/01.ptx b/source/calculus/source/01-LT/01.ptx index 56001c83c..15eac3529 100644 --- a/source/calculus/source/01-LT/01.ptx +++ b/source/calculus/source/01-LT/01.ptx @@ -30,7 +30,9 @@ A graph of a function that has not been rendered properly. - + + +

Imagine moving along the graph toward the missing portion from the left, so that you are climbing up and to the right toward the obscured area of the graph. What y-value are you approaching?

@@ -41,9 +43,17 @@
  • 2

  • 2.5

  • +
    + +

    + B. 1 +

    +
    +

    + Think of the same process, but this time from the right. You're falling down and to the left this time as you come close to the missing portion. What y-value are you approaching?

      @@ -53,8 +63,15 @@
    1. 2

    2. 2.5

    +
    + +

    + B. 1 +

    +
    +

    @@ -75,11 +92,19 @@ +

    What is the value of f(2)?

    + + +

    + Does not exist. +

    +
    +

    What is the y-value that is approached as we move toward x = 2 from the left?

    @@ -90,8 +115,15 @@
  • 2

  • 2.5

  • +
    + +

    + B. 1 +

    +
    +

    What is the y-value that is approached as we move toward x = 2 from the right?

    @@ -102,14 +134,18 @@
  • 2

  • 2.5

  • +
    + +

    + B. 1 +

    +
    -

    When studying functions in algebra, we often focused on the value of a function given a specific x-value. For instance, finding f(2) for some function f(x). In calculus, and here in and , we have instead been exploring what is happening as we approach a certain value on a graph. This concept in mathematics is known as finding a limit.

    -
    @@ -164,7 +200,8 @@ --> - + +

    What is the limit as x approaches 0 in ?

    @@ -174,7 +211,13 @@
  • The limit is 0

  • The limit is not defined

  • - +
    + +

    + D.

    The limit is not defined

    +

    +
    +
    @@ -204,6 +247,7 @@ +

    Which of the following best matches the definition of right and left limits? (Note that DNE is short for "does not exist.")

    @@ -214,8 +258,15 @@
  • The left limit is -1. The right limit DNE.

  • The left limit DNE. The right limit DNE.

  • +
    + +

    + A.

    The left limit is -1. The right limit is 1.

    +

    +
    +

    What do you think the overall limit equals?

    @@ -225,6 +276,12 @@
  • The limit is 0

  • The limit is not defined

  • +
    + +

    + D.

    The limit is not defined

    +

    +
    @@ -250,26 +307,56 @@ +

    Find \displaystyle \lim_{x \to -3^-} f(x) and \displaystyle \lim_{x \to -3^+} f(x).

    +
    + +

    + \displaystyle \lim_{x \to -3^-} f(x) = 3 and + \displaystyle \lim_{x \to -3^+} f(x)= 3 +

    +
    +

    Find \displaystyle \lim_{x \to -1^-} f(x) and \displaystyle \lim_{x \to -1^+} f(x).

    +
    + +

    + \displaystyle \lim_{x \to -1^-} f(x)=2 and \displaystyle \lim_{x \to -1^+} f(x) = DNE +

    +
    +

    Find \displaystyle \lim_{x \to 2^-} f(x) and \displaystyle \lim_{x \to 2^+} f(x).

    +
    + +

    + \displaystyle \lim_{x \to 2^-} f(x)= 0.5 and \displaystyle \lim_{x \to 2^+} f(x) = -3 +

    +
    +

    Find \displaystyle \lim_{x \to 4^-} f(x) and \displaystyle \lim_{x \to 4^+} f(x).

    +
    + +

    + \displaystyle \lim_{x \to 4^-} f(x) =-3 and \displaystyle \lim_{x \to 4^+} f(x) = -3 +

    +
    +

    For which x-values does the overall limit exist? Select all. If the limit exists, find it. If it does not, explain why.

    @@ -279,10 +366,16 @@
  • 2
  • 4
  • +
    + +

    + At A. -3 and D. 4, the limit exist. +

    +
    - +

    Sketch the graph of a function f(x) that meets all of the following criteria. Be sure to scale your axes and label any important features of your graph.

      @@ -299,9 +392,9 @@
    1. \displaystyle \lim_{x\to -1^-} f(x)=-1 but \displaystyle \lim_{x\to -1^+} f(x)\neq-1.

    -
    +
    - +

    Suppose that:

    @@ -320,12 +413,14 @@

    The part of the theorem that starts with “Suppose…” forms the assumptions of the theorem, while the part of the theorem that starts with “Then…” is the conclusion of the theorem. What are the assumptions of the Squeeze Theorem? What is the conclusion?

    +

    The assumptions of the Squeeze Theorem can be restated informally as “the function g is squeezed between the functions f and h around a.” Explain in your own words how the two assumptions result into a “squeezing effect.”

    +
    @@ -350,16 +445,27 @@ A pictorial example of the Squeeze Theorem. +

    Match the functions f(x), g(x), h(x) in the picture to the functions \cos(x), 1, \dfrac{\sin(x)}{x}.

    + +

    + f(x)= \cos x, g(x)= \dfrac{\sin(x)}{x}, and h(x)= 1 +

    +

    Using trigonometry, one can show algebraically that \cos(x) \leq \dfrac{\sin(x)}{x} \leq 1 for x values close to zero. Moreover, \displaystyle\lim_{x \to 0} \cos(x) = \cos(0)=1 (we say that cosine is a continuous function). Use these facts and the Squeeze Theorem, to find the limit \displaystyle\lim_{x\to 0} \dfrac{\sin(x)}{x} .

    + +

    + \displaystyle\lim_{x\to 0} \dfrac{\sin(x)}{x} = 1 +

    +
    @@ -375,7 +481,7 @@ Exercises

    - Exercises available at + Exercises available at

    diff --git a/source/calculus/source/01-LT/02.ptx b/source/calculus/source/01-LT/02.ptx index 1b45d642f..20486e058 100644 --- a/source/calculus/source/01-LT/02.ptx +++ b/source/calculus/source/01-LT/02.ptx @@ -13,6 +13,7 @@ Activities + @@ -69,6 +70,8 @@
    + +

    Based on the values of , what is the best approximation for \displaystyle\lim_{x\to 7} f(x)?

      @@ -78,7 +81,15 @@
    1. the limit is approximately 0.1667

    2. the limit is approximately 6.9999

    +

    +
    + + +

    + D. The limit is approximately 0.1667 +

    +
    @@ -156,6 +167,11 @@ the function as x tends to 2?
  • The limit can be approximated to be 1 because the values appear to approach 1 and the graph appears to approach 1, but we should zoom in on the graph to be sure.

  • The limit cannot be approximated because the function might not exist at x = 2.

  • + +

    + C. The limit can be approximated to be 1 because the values appear to approach 1 and the graph appears to approach 1, but we should zoom in on the graph to be sure. +

    +
    @@ -223,6 +239,11 @@ the function as x tends to 2?
  • \displaystyle \lim_{x\rightarrow 1^-}f(x) = 0.5,\,\, \lim_{x\rightarrow 1^+}f(x) = -0.5, and \displaystyle\lim_{x\rightarrow 1}f(x) does not exist

  • \displaystyle \lim_{x\rightarrow 1^-}f(x) = 0.5,\,\, \lim_{x\rightarrow 1^+}f(x) = -0.5, and \displaystyle\lim_{x\rightarrow 1}f(x) = 0

  • + +

    + B. \displaystyle \lim_{x\to 1^-}f(x) = -0.5,\,\, \lim_{x\rightarrow 1^+}f(x) = 0.5, and \displaystyle\lim_{x\rightarrow 1}f(x) does not exist +

    +
    @@ -231,6 +252,7 @@ the function as x tends to 2?

    Consider the following function f(x)= 3x^3 + 2x^2- 5x+20.

    +

    Of the following options, at which values given would you evaluate f(x) to best determine \displaystyle \lim_{x \to 2}f(x) numerically?

      @@ -239,11 +261,23 @@ the function as x tends to 2?
    1. 1.8, 1.9, 2.0, 2.1, 2.2

    2. 1.0, 1.5, 2.0, 2.5, 3.0

    - +
    + +

    + B. 1.98, 1.99, 2.0, 2.01, 2.02 +

    +
    +

    Use the values that you chose in part (a) to calculate an approximation for \displaystyle\lim_{x \to 2}f(x).

    +
    + +

    + 41.22, 41.61, 42, 42.39, 42.78 +

    +

    Which value best describes the limit that you obtained in part (b)?

    @@ -254,7 +288,11 @@ the function as x tends to 2?
  • The approximate value is 41.75

  • The approximate value is 42

  • - + +

    + D. The approximate value is 42. +

    +
    @@ -341,13 +379,26 @@ the function as x tends to 2?
  • The limit does not exist because you are dividing by zero when x = 0 for f(x).

  • - + + +

    + C. The limit does not exist because the function is oscillating between -1 and 1. +

    +
    +

    Would your conclusion that resulted from change if the function was f(x) = \cos(1/x) or f(x) = \tan(1/x)?

    -
    + + +

    + No, both f(x) = \tan(1/x) and f(x) = \cos(1/x) oscillate as x tends to 0. +

    +
    + +

    Use technology to complete the following table of values. @@ -364,7 +415,9 @@ Then explain how to use it to make an educated guess as to the value of the limit \displaystyle \lim_{ x\to -3 } \dfrac{ x^{2} - x - 12 }{ x^{2} + 16 \, x + 39 }

    - +